all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

Script help?


Script help? kempy1
4/26/2005 12:00:00 AM
flash actionscript:
Trying to call a PDF file using Flash and this is the error I get, does anyone
know why this will not work???

Scene=Scene 1, Layer=WorkSheets, Frame=2219: Line 1: Statement must appear
within on handler
fscommand("exec",
"cmd.exe"+chr(9)+"/c"+chr(9)+"start"+chr(9)+"Questions.pdf");

:(
Re: Script help? Sivakanesh
4/26/2005 12:00:00 AM
I assume you have this code under a button. You have to tell the button when
to run the code (press, release etc.)
And you don't need fscommand for this.

Try this

on(press){
getURL("Questions.pdf");
}
Re: Script help? scottPadgett
4/26/2005 12:00:00 AM
Re: Script help? kempy1
4/26/2005 12:00:00 AM
Re: Script help? kempy1
4/26/2005 12:00:00 AM
I am having more problems, I have the PDF on the local machine in the same
folder as the flash file, when I try to call it mozila fire fox tries to find
the file???

but it did work the first time??

Code:

on(press){
getURL("Questions.pdf");
}

Re: Script help? kempy1
4/26/2005 12:00:00 AM
Re: Script help? Sivakanesh
4/26/2005 12:00:00 AM
Not sure why it the 1st time and not now.
But can you try and hardcode the fullpath to the pdf and see if it works. So
the code will be

on(press){
getURL("c:\xxxx\yyyy\Questions.pdf"); //or something like that.
}

If you are going to put this on to a website then you will need to use the
full url. I heard that Firefox treats relative path differently.
If this works then, you can put a piece of code that dynamically figures out
the full path later.

Re: Script help? scottPadgett
4/26/2005 12:00:00 AM
Re: Script help? scottPadgett
4/26/2005 12:00:00 AM
Re: Script help? kempy1
4/26/2005 12:00:00 AM
The first time I tried to call the PDF file I published the flash file as an
HTML format and it worked. All other times I just exported the file to preview
it, so when I preview it calls up mozilla, but when I publish it using the HTML
file it works and calls up the PDF. To me this is strange but at least I know
how to get it to work now. Thanks again guys.

Kempy1

AddThis Social Bookmark Button