Here's how to open a pdf via a projector

hey all,

just thought i would share some knowledge i found out today.
Like a number of you, i have created a projector file for use on cd/dvd rom. however one of the things i was wanting to do from this projector was to open .pdf files.

I tried the getURL method which didn’t work, so I searched around and found the fscommand functions. Apparently you can open .exe files which many of you know. Pre-Flash MX, the fscommand function used to be able to open specific files and more, but since, it has been limited to just a select few functions, one of which is stillthe ability to open .exe files.

This is good and all, but how does this help with opening a **.pdf **file?
Well it doesn’t really, without the use of a small, free, 3rd party .exe file, which can be found over here:
http://flashgeek.com/tutorials/07_launchapp_01.asp
I found this link after searching the forums here, and found the answer to my projector/.pdf problems!

Read what it has to say and download it. I found the instructions a little confusing to understand, so I have decided to clear them up a little for those who are little vague on all this scripting, 3rd party programme stuff.

Once the file is downloaded and uncompressed, follow these instructions.

  1. Create a new folder in your root folder called fscommand (the root folder is where you will export your final projector file).
  2. Copy the .exe and the .txt file to the the **fscommand **folder.
  3. Copy your .pdf file to the **fscommand **folder as well. (my **.pdf **was called case_studies.pdf).
  4. Rename the .exe and the .txt file to be the same as your .pdf (in my case these would become case_studies.exe and case_studies.txt).
  5. Open your .txt file (in my case, case_studies.txt, and change the text between the brackets (topmost line) to be the path of your .pdf. So for me it would look like this: “case_studies.pdf”. In this case i used a relative path to my projector file. You may ask why I didn’t include the **fscommand **folder in this path. Well, Flash automatically knows to look in this folder when using a fscommand, so there is no need to include it.
  6. Lastly, open you Flash document, locate the button you with to open your .pdf with and put this code on it:
on (release) {
	fscommand("exec", "case_studies.exe");
}

And that’s it! Export your projector from Flash, open it and click on your button. Provided there is a default programme for opening .pdfs on your computer and any potential users, Flsh will open the .pdf over top of your projector. When you close it, you return to the projector.
(Note: You must export as a projector. It will not work if you test movie or export as a .swf)

This method can be used to open other file types as well, such as HTML pages, images etc. Have a play, see what it can do.

If anyone needs further help, just give me a buzz and i’ll help out if possible.
Thanks to Rick Turoczy over at Flashgeek.com for this wonderful little work around. It’s free and fairly straightforward, and most of all it works.

Cheers,

Enforcer73