[問題] 關於FileReference的download()

看板Flash作者 (123)時間16年前 (2010/06/09 14:08), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
各位大大午安~又有點問題想要詢問 我想要製作一個按鈕可以讓user點下之後可以開啟下載對話視窗,並且完成下載。 我也已經將圖檔上傳至網路空間。 以下是我做的範例,但是沒有實際下載到圖檔。 不知道是不是環境的問題。 也沒有觸發到 Event.OPEN、ProgressEvent.PROGRESS http://megaswf.com/view/bd02f1b61e5bee9bc1edfb239aaddd1c1.html 以下是我的code: var _file:FileReference = new FileReference(); load_btn.addEventListener(MouseEvent.CLICK,download); function download(e:MouseEvent):void{ _file.download(new URLRequest("http://img38.imagefra.me/img/img38/6/6/8/ openyayak/f_dduekgm_9ee38aa.jpg"),"BMW.jpg"); } _file.addEventListener(Event.OPEN,openfile); function openfile(e:Event):void{ // do something... } _file.addEventListener(ProgressEvent.PROGRESS,openselect); function openselect(e:ProgressEvent):void{ // do something... } _file.addEventListener(Event.COMPLETE,complete_end); function complete_end(e:Event):void{ // do something... } 謝謝大家 O_O" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.125.26.94

06/10 09:41, , 1F
@@"
06/10 09:41, 1F
文章代碼(AID): #1C3o_o58 (Flash)
文章代碼(AID): #1C3o_o58 (Flash)