Flex ~ FileReference can't download, FileReference download problem

如果是把FileReference宣告在function裡就會無法下載

要宣告在全域變數..........

---------------------------------------------------------------------------------
private var file:FileReference = new FileReference();
private function DoDownload(e:MouseEvent):void{

var url:String = _downloadAddress + "?R=";

var ran:Number = Math.random();
var req:URLRequest = new URLRequest(url + ran);

file.addEventListener(ProgressEvent.PROGRESS, StartDownload);
file.addEventListener(Event.COMPLETE, FileCompleteEvent);
file.download(req);

}
---------------------------------------------------------------------------------

如果寫在裡面 ~~~~~就會跟我一樣~~~~~ 一下載就整個卡住不會動~~~~

private function DoDownload(e:MouseEvent):void{

private var file:FileReference = new FileReference();

blablablablablablablablablablablablablablablablablabla
}


這問題鳥爆了..........害我弄超久............


reference:
http://www.learnosity.com/techblog/index.cfm/2007/7/16/Filereference-download-problem--solved

沒有留言:

發佈留言