Hey all,

I'm having real problems with FileReference download.
I'm doing the following... the class is created with a verified URL and legit filename.
The .download() call returns success
I get the OS dialog box (Mac OSX 10.4.5 - also tried online on Win XP)
I select a folder, and hit "Save"

Then, Flash Authoring crashes!
I get no trace output (that I can see before the crash)

Tried online, it just hangs.

In neither case does the server show any record of an attempt to access the chosen file.

I realize there could be sandbox issues, but I doubt this is the problem
(the url online is from the same domain, and this shouldn't cause a crash in Authoring anyway)

Anyone have experience with download()?
Any gotchas I may have overlooked here?

Should "onOpen" at least be called when the dialog box is opened?
Or is this called when the socket is opened?

Thanks in advance for any help...
--Dave




import flash.net.FileReference;
class as.aDownloader {
        private var oListener:Object;
        public function aDownloader( sUrl:String, sFN:String ) {
                this.oListener = new Object();
trace("downloading, url="+sUrl);
oListener.onCancel = function(file:FileReference):Void { trace ("onCancel: " + file.name); }; oListener.onComplete = function(file:FileReference):Void { trace ("onComplete: " + file.name); }; oListener.onIOError = function(file:FileReference):Void { trace ("onIOError: " + file.name); }; oListener.onSecurityError = function(file:FileReference, errorString:String):Void { trace("onSecurityError: " + file.name); }; oListener.onOpen = function(file:FileReference):Void { trace ("onOpen: " + file.name); }; oListener.onSelect = function(file:FileReference):Void { trace ("onSelect: " + file.name); }; oListener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
                        trace("onProgress: bytes=" + bytesLoaded + "/" + 
bytesTotal );
                };              
                var fileRef:FileReference = new FileReference();
                fileRef.addListener(oListener);
                if ( !fileRef.download(sUrl,sFN) ) { trace("dialog box 
failed!"); };
        }
}
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to