
Page 1 of 1
Jesse Stratford
Jesse lives and works in Melbourne Australia. He is the Cofounder of http://ActionScript.org. A Flash enthusiast, teacher, author, freelancer and speaker Jesse's main focus nowadays is managing http://ActionScript.org, but he enjoys participating actively in community and the wider Flash scene when he has time.
View all articles by Jesse StratfordTime: 15 minutes
Difficulty Level: Beginner
Requirements: Flash 4 or higher.
Topics Covered: fscommand(), start.exe.
Assumed knowledge: None.
Flash player changes & their impact upon this tutorial:
Before we begin users should note that Macromedia altered the access EXEC has to the system to prevent malicious coders from causing trouble. Executables must now exist within a specific directory. Read this article at Macromedia's help site for information about where to put your executable in order for it to comply with these security restrictions.
These changes nullify the usefulness of the old version of this tutorial somewhat. The "start" executable which this tutorial relied upon resides in the Windows directory and, as such, can't be made to comply with Macromedia's directory structure security requirements. For Windows systems you can however create a batch file (.bat) which invokes the start executable, then put this batch file in the correct directory. For Mac systems you can use Apple Script in the same manner. Both of these are mentioned at the link Macromedia help article above but not discussed in any detail.
This tutorial now provides an example of using a Windows batch file to execute files from locations other than the 'fscommand' directory. Windows users, grab this Flash MX source file and take a look. If someone wants to send me a working Apple Script example via email, I'll post it here too.
The old version of this tutorial (who's methods cannot be applied in any version of the Flash standalone player above Flash 5) has been moved to the Archives area of the Tutorial section; see the Tutorials index for a link to it if you need it.
Spread The Word
Related Articles
3 Responses to "Execute Files from Local Presentations" 
|
said this on 17 Jul 2007 1:37:08 PM CST
Yeah, your example really helps when trying to open some pps xls or some exe's ! but, i would like to know if there is any way to open this kind of documents withouth having to see the MSDOS window. like opening the MSDOS window under the other windows that may be open.
Great Tutorial! Thanks! |
|
said this on 31 Oct 2007 6:04:18 AM CST
Yeah, there is another way! Try the following...
on (press) { getURL("file:///C:/Program Files/Microsoft Office/OFFICE11/OUTLOOK.EXE", ""); } Your browse will prompt you to run the file... |
|
said this on 27 Apr 2008 7:09:38 AM CST
Using FScommand in flash, you can launch external applications. Things to note are -
1. You can only do this from a projector (exe made using publish), not a SWF. 2. The external executable file has to be in a subfolder named "fscommand" in the same folder as your projector file (this is for some security reasons). 3. Using this you can only launch an EXE or a BAT file. 4. Flash MX does not let you pass any parameters to the external executable. If you want to work in flash 5, this link will be of particular interest to you http://flashtools.net/. Now, if you want to launch anything like an Excel or Word document or any other document like a PDF or maybe even a PowerPoint presentation, you this tool by flashgeek.com. This is the code that will go on any button in your flash projector file. on (release) { fscommand ("exec", "flashgeek.exe"); } Now flashgeek.exe goes in the fscommand folder along with the text file "flashgeek.txt". You have to specify the path and file name of the object you would like to open in flashgeek.txt (the path can be relative or hardcoded). Please note 1. Name the executable and the text file the same name (like flashgeek.exe and flashgeek.txt). 2. For each document that you want to open, you'll have to have a set of the exe and text file like flashgeek1.exe and flashgeek1.txt and so on. You can also check freemx. It is a similar tool with advanced features like detecting flash plug-in etc. http://www.programmingtalk.com/archive/index.php/t-32357.html |



Author/Admin)