2/6/2011 1:31:29 AM
Title:
Load PDF from Local PC
In Flash CS5 (as3)
I have been using the code below to load a pdf, on button click. I want this to open in its own window. The only code I can find is:
certificate_btn.addEventListener(MouseEvent.CLICK, certificate);
function certificate(event:MouseEvent):void
{
navigateToURL(new URLRequest("certificate.pdf,html"));
}
It opens up a URL, but does not display the pdf. Instead of 'navigateToURL' is there another code that will load of local pc's? I read something that said to import the pdf, but it comes up with an error and can not read the file.
2/6/2011 6:48:12 AM
the above code is only useful to load files from a url or file residing on a server. There is no way to load local files of an system in flash. The above code will only load file if it resides in the same directory from where swf is loaded .
i.e abc.com/myswfFile.swf
abc.com/certificate.pdf
2/6/2011 10:33:50 AM
you cannot access the local files from with in flash file (swf) You can just browse the files and upload to server