【发布时间】:2010-02-01 23:58:06
【问题描述】:
我正在尝试在 for 循环中加载外部 SWF,但我遇到了一个非常困扰我的问题:在事件处理程序中,我需要知道已加载的 SWF 的文件名,但我无法获取这。下面的代码显示了我正在尝试做的事情。
有人知道吗?
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?
}
感谢您的帮助!
【问题讨论】:
标签: flash actionscript-3 event-handling closures