Hi, i'm developing an app that use swf to load elements and add properties to the loaded swf. I use SWFLoader to load the movie and on the COMPLETE event i move the loaded MovieClip to a specific frame and then list its DisplayList. I've discovered that if i traverse the list soon it's note loaded. Maybe it's cleaner with code:
loader.addEventListener(Event.COMPLETE, function(evt:Event):void{
var mc:MovieClip = MovieClip(loader.content);
mc.gotoAndStop(frameNumber);
for(i = 0; i < mc.numChildren; i++){
trace(mc.getChildAt(i));
}
}
I miss some children from the loaded swf and in some cases i get null values. Now i've added a Timer() that wait 250ms before listing the display list and works but it's very slow and inefficient.
The other strange behaviour is that with the previous snippet i can't get some MovieClip, even with the Timer in place. I had to insert a function in the loaded swf like this:
function getItems():Array{
var res:Array = [];
for(var i:uint = 0; i < this.numChildren; i++){
res.push(this.getChildAt(i));
}
return res;
}
To retrieve the correct list of children.
Thanks a lot