2
我試圖在for循環中加載外部SWFs,並且我遇到了這個問題,它確實在吞噬我:在事件處理程序中,我需要知道SWF的文件名加載,但我無法獲得此。下面的代碼顯示了我想要做的事情。AS3:在for循環中加載SWFs
有沒有人有什麼想法?
function loadManySWFs(arrayOfFileNames:Array)
{
for(var i=0; i<arrayOfFileNames; i++)
{
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest(arrayOfFileNames[i]));
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
mLoader.load(mRequest);
}
}
function onLoadComplete(e:Event)
{
// Here I need to know the filename of the SWF that was loaded. How can I do this?
}
感謝您的幫助!
@maxmc'event.target'將是註冊事件偵聽器的'LoaderInfo'對象。編輯修復它。 – Amarghosh 2010-02-02 08:06:45
@Amarghosh:謝謝 – maxmc 2010-02-02 17:06:32