Solved

How do you execute a specific file (in my case .ppt) from a button in a Flash Projector file and have it open in the correct application?

Posted on 2009-05-13
4
275 Views
Last Modified: 2012-05-06
I have built a presentation in Flash that is delivered via CD as a Projector File. My client has requested a button that would open a PowerPoint deck that would also be on the CD in its own directory. Is this possible? I am on a MAC but this would primarily be used on PC's. However, a solution for both would be much appreciated.
0
Comment
Question by:kwood79
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
quizengine earned 500 total points
Comment Utility
I can't help you with a Mac, but the following link is a tried and tested method on a PC

http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy
0
 
LVL 4

Expert Comment

by:manavsi
Comment Utility
Using fscommand to launch is the way... let me tell u how to do that here both in mac and windows using apple scripts and Batch commands

to get fscommand exec, to work in mac, you need to:

Ctrl click, "myflashprojector.app" and click "Show Package Contents" copy the fscommand folder into MacOS (its a subfolder of "Contents") and then it will work... This is because its a bug found in FlashCS3...

putting all the .pdf's or .rtf's that you want to open through the flash, into the fscommand folder, well you probably already know that this would double the size of the disk, And thats true, but with a little work you will only need the .bat's and the applescripts to be in the fscommand folder

so i'm going to give you some snippets of .bat codes and apple scripting that can open up a file no matter where it is (well almost)

Lets start with the .bat file (hope u know to work with BATCH)

@echo off

start ../"Pdf Folder"/"my Pdf".pdf

@exit

Now what this code does is, it goes one folder up, and into another folder,and opens the pdf, and once started the command prompt will pop up, but there won't be any text in it, and once the file is open the command prompt will close. something else important to know is, files or folders containing a SPACE
will need to have qoutation marks or it will tell you it cant find the file.

If you dont want to have the command prompt come up at all, there is a proxy .exe floating around you can google it and find out how to use it. (refer here: http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy)

In batch here is one more thing that need to be taken into consderation: refer here: http://www.northcode.com/blog.php/2008/07/28/Fixing-the-Windows-Start-Command-in-Vista
This is for Proxy with MS Vista

Now for the applescript

tell application "Finder"

activate

open document file "file.pdf" of folder "Pdf folder" of disk "name of disk here"

end tell

Well thats it, i hope this helps people.
0
 

Expert Comment

by:craigbic
Comment Utility
Remember that fscommand will only work in the Flash projector file (not from the .fla or within html). Create a batch file (filename.bat, test.bat etc...) using a text editor like Notepad in a directory called "fscommand" in the same location as the Flash projector. Add the following for a PC:

@ echo off
start <file to load> (i.e. U:\testing.ppt, or C:\excelFiles\test.xls etc..)
exit

Save the .bat file.

Next, use a button or a function to call the following in actionscript:

fscommand ("exec", "test.bat");

omit any directory structure here since Flash ALWAYS assumes that this file is in a folder called "fscommand" located where the Flash projector is located.

Publish the projector file and run to test. You should see a quick flash of the DOS window (PC) and then your file should load in it's appropriate application.
0
 
LVL 19

Expert Comment

by:quizengine
Comment Utility
And if you want to avoid that (IMO, ugly) DOS box appearance, use the 'proxy.exe' file from Northcode (the original link I gave above).
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now