Downloading A Pdf Within A Flash Movie

I am trying to figure out how to offer a downloadable pdf from a flash movie i have made. I’ve made the button for it but I can’t understand how to reference the file with actionscript to get the pdf from my server and download it to their computer. Any one have a quick solution?

Thanks


on (release) {getURL("yourfile.pdf");

TD

This might work, but also might not if the user has the acrobat browser plug-in installed; in that case, it would open in the browser!
(of course, the user can then still hit the “save” button, but your page will be history -literally, user’ll have to hit “back”…)
Best way is to zip it.

But some people (XP users for example) have it so that ZIP files are being automatically opened :-/

Ok, I’m still learning alot of this so bare with me – The actionscript above says to getURL “yourfile.pdf” but the issue is, the PDF will be on a different location than the flash file on the server for whatever reason. So, how do I tell it to get the file from say www.mywebsite.com/yourfile.pdf?
Or do I just stick that in quotes instead of just the yourfile.pdf like it is written above? And I will probably just zip it to be on the safe side.

I know I’m making this harder than it should be. I guess the main point I don’t get is who it knows where to look for the file unless you have a specific URL or location as to where the external file is.

Thanks for all the help

Flash does not know :slight_smile:
You gotta tell him/her/it.
So either as per above,
if the pdf is in the same folder as the swf;
or as per your reply, if it’s not,
getURL(“http://www.fullpath.com/tofolder/andsubfolder/etc/yourpdfisin.pdf”)
Why not start by reading the Flash Help files about getURL…?