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
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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.
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.

739 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