I'm trying to load external SWFs in a for loop, and I have this problem that is really eating me: In the event handler I need to know the filename of the SWF that was loaded, but I can't obtain this. The code below shows what I'm trying to do.
Does anybody have any idea?
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?
}
Thanks for any help!