View Full Version : open an external file with AS3
TRixation
August 23rd, 2007, 06:02 AM
Hi All....does anyone know how to open an external file on your hard drive from your swf and .EXE using AS3? I wana click on a button and basically just open a PDF
Searched high and low and even liveDOCS hasnt got an answer.
Thanks a million
:thumb2:
Keeno
August 23rd, 2007, 06:31 AM
open it as a URL
navigateToURL()
devonair
August 23rd, 2007, 06:34 AM
Might want to check out AIR development.. http://agknology.com/blog/http:/agknology.com/blog/air/29
there are also 3rd party "swftoexe wrappers" such as swfkit or zinc you could look into..
Keeno
August 23rd, 2007, 06:46 AM
Might want to check out AIR development.. http://agknology.com/blog/http:/agknology.com/blog/air/29
there are also 3rd party "swftoexe wrappers" such as swfkit or zinc you could look into..
i dont think air can execute shell commands ?
zinc is amazing! If air could do everything Zinc could we would be laughing
if your app is an offline app zinc will do it.
TRixation
August 23rd, 2007, 07:00 AM
Thanks for the help...managed to do this and it works like a charm: :)
import flash.net.navigateToURL;
import flash.net.URLRequest;
myButton.addEventListener(MouseEvent.CLICK, goPDF);
function goPDF(event:MouseEvent):void {
var url:String = "UserGuide/USER-GUIDE.pdf";
var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}
devonair
August 23rd, 2007, 07:04 AM
i dont think air can execute shell commands ?
it can't, but if you check out that link, it basically uses an HTML object instance to display the .pdf
zinc is amazing! If air could do everything Zinc could we would be laughing
if your app is an offline app zinc will do it.
Personally, I found zinc to be horrible. It's buggy (if your registered at their forum, check out this thread: http://www.mdmforum.com/forum/index.php?showtopic=13837) and AS3 support is horrible.. SWFKit is my fave if AIR won't do the trick..
Keeno
August 24th, 2007, 04:03 PM
it can't, but if you check out that link, it basically uses an HTML object instance to display the .pdf
Personally, I found zinc to be horrible. It's buggy (if your registered at their forum, check out this thread: http://www.mdmforum.com/forum/index.php?showtopic=13837) and AS3 support is horrible.. SWFKit is my fave if AIR won't do the trick..
indeed, i had to learn flex becuase zinc didnt use AS3, dunno if they fixed that yet
to be honest, i totally forgot about that :D
i did however use it in flex with AS3 for a project. Go figure. Just doesnt with Flash.
it has gotten me out of a lot of tricky situations however :)
IvaK
June 24th, 2010, 08:56 PM
Hi everyone!
I just googled and found this thread which I need very bad!
I'm building a standalone EXE application, and I need to open some files just like the user TRixation wanted exept I want to open another Flash EXE or SWF. I've used a code you've provided, but when I use it in application, an internet browser is opening wanting to download or open that URL. That's annoying and I want to ask is there any chance to avoid this? Just to open raw EXE, SWF files instant?
Thank you in advance! Cheers!
IvaK
July 4th, 2010, 05:04 AM
Sorry for double posting, but can anyone please respond?
pradvan
October 26th, 2010, 06:05 PM
Anyone got a solution to this?
Need to open an exe without using navigateToURL.
Would prefer not to use 3rd-party wrappers...
joeycrash135
October 26th, 2010, 09:41 PM
this post has the answer for you, scroll down to the end.
http://www.kirupa.com/forum/showthread.php?t=356089
pradvan
October 27th, 2010, 09:34 AM
Thank you for the reply.
So the short answer is that you can't do it without a 3rd-party wrapper. :(
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.