Launching a pdf from flash (this seems to work)

i had to launch a pdf file from a flash website and couldn’t get it to work. kept getting an error message on windows xp SP2 saying “Action cancelled, Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable.”

anyway, as luck would have it, i was studying up on the 'ol .htaccess file so i could redirect a page in my portfolio for something else. it gave me the idea to point the link in flash to an html page, then have that page redirect to the pdf file so that it launches perfectly. i tested it out on IE and Firefox and seems to work perfectly. not sure how great of a workaround this is, but so far it’s done the job. if anyone finds some flaws, please post as i’m interested to see how compatible this truly is.

to do this, place this code on your flash link/button:

on(release){
getURL(“http://www.mysite.com/pdfredirect.htm”);
}

open up your text editor and type this into it:

[SIZE=2]Redirect /pdfredirect.htm http://www.mysite.com/mypdf.pdf[/SIZE]

[SIZE=2]and name that file .htaccess[/SIZE]

[SIZE=2]upload that file to the root of your website. if you already have an .htaccess file on the root of your website, DON’T OVERWRITE IT! just add that line on the top of the existing one.[/SIZE]

[SIZE=2]anyway, when you click the link in the flash player, the pdf seem to launch fine. just thought this might help someone out. :beer:
[/SIZE]