[問題] 上傳檔案時如何避免檔案被重複選取?

看板Flash作者 (布萊恩)時間18年前 (2007/12/10 18:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我在上傳檔案時自行 maintain 了一份檔案清單 希望能在把filereference加入清單前檢查是否已經在清單裡了 但是他每次都把一樣的檔案當成不一樣的檔案 請各位前輩幫我看一下 到底是哪邊寫錯了? 程式碼如下: function frl_Select(event:Event):void { for (var i:uint = 0; i < frl.fileList.length; i++) { if (fileList.indexOf(frl.fileList[i]) == -1) { fileList.push(frl.fileList[i]); sizeLoaded.push(0); sizeTotal += frl.fileList[i].size; Lbl_Progress.text = generateLblProgressText(); } else { ExternalInterface.call("exceptionHandler", "Duplicate File : The " + frl.fileList[i].name + " will not add to upload list."); } } ExternalInterface.call("showFiles", fileList); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.118.92
文章代碼(AID): #17NGwC9g (Flash)
文章代碼(AID): #17NGwC9g (Flash)