PDA

View Full Version : [AS2] Opening a pdf with flash


Halcyon Dtier
07-20-2009, 01:50 AM
I'm creating a cd where a flash.exe will autorun and I'd like for the user to be able to open pdfs by clicking on buttons in the flash file.

I've tried using the following code:

//when button is released, open the pdf document:
btnMyButton.onRelease = function() {
getURL("test.pdf", "_blank");
};


it comes back with "statement must appear within on handler"
Anyone got any ideas on how to fix this? (I'm a real newb with AS).

Thanks in Advance.

workin'stiff
07-20-2009, 02:03 AM
I just ran into something like this recently. Did you ensure that this scripting is on a frame on the timeline and not being placed physically on the button?

Halcyon Dtier
07-21-2009, 12:23 AM
Thanks workin'

It's been a while since I did any flash work. I've now got the AS running where it should be.

But the code still isn't working. When I export a swf file and place it in a folder with a pdf called "test.pdf" nothing happens.

I'm thinking either that I can't use url in my code to call a non-html file or that I need to put in a absolute address.

Any suggestions?

Edit: I tried putting a absolute url in and it made no difference: C:\Documents and Settings\documents\Desktop\flash