Improve company productivity with a Business Account.Sign Up

x
?
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
Medium Priority
?
300 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 1500 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

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

585 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