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
279 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
ID: 24376662
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
ID: 24378286
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
ID: 24386670
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
ID: 24386956
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

920 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

17 Experts available now in Live!

Get 1:1 Help Now