Jump to content

download exe from server


udi

Recommended Posts

in my site there is a button which have action as follows:on(release){import flash.net.FileReference;var listener:Object = new Object();listener.onSelect = function(file:FileReference):Void {trace("onSelect: " + file.name);}listener.onCancel = function(file:FileReference):Void {trace("onCancel");}listener.onOpen = function(file:FileReference):Void {trace("onOpen: " + file.name);}listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);}listener.onComplete = function(file:FileReference):Void {trace("onComplete: " + file.name);}listener.onIOError = function(file:FileReference):Void {trace("onIOError: " + file.name);}var fileRef:FileReference = new FileReference();fileRef.addListener(listener);var url:String = "http://www.tovale.co.il/udiphone.exe";if(!fileRef.download(url, "udiphone.exe")) {trace("dialog box failed to open.");}}the "udiphone.exe" loaded includes " loadMovie("target"); " the target is a jpg picture.when executing the exe in my computer it loads the jpg which is included in the same folder, with no problem, however when the exe is loaded from the site - and saved in a folder which includes the jpg file - the picture is not loaded.what is the problem?Text

Link to comment
Share on other sites

  • 1 month later...

To do such thing, and be sure it works at 100%, I recommend using a a swf2exe program.I really like SWF Studio V3, as it is rock solid and works under Win95 and up (including Vista). They are others like Zinc from MDM which is also nice.With it, you can do stuff like:loadmovie("startdir://mypicture.jpg");Were startdir:// by the swf2exe tool mentioned above will find the full path where the exe itself is located. (I don't know about the other swf2exe tools how this works but for sure they have a way.)NOTE: the startdir://will NOT work under your swf, or withing Flash, You NEED to transform your swf into an EXE WITH the swf2exe program (thsi appies to all other swf2exe software arround)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...