how to know the current SWF loaded
Hi all,
I'd like to do if a certain SWF is loaded do some actions:
I upload many swf at the same location and the user can navigate them with Next and Back buttons.
one of the swf has some buttons.
I'd like to check if that swf is loaded then do some action.
how ?
page.addChild(swfLoader);
var ext:MovieClip;
var ch1_btns:Array;
swfLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, onCompleteLoad);
function onCompleteLoad(e:Event):void
{
ext = MovieClip(swfLoader.content);
ch1_btns = new Array(ext.less1, ext.less2, ext.less3, ext.less4, ext.less5, ext.less6, ext.quiz);
for(var k:Number = 0; k < ch1_btns.length; k++)
{
ch1_btns[k].addEventListener(MouseEvent.CLICK, onChapter1Buttons);
}
}
in the code above, I have created an array of the buttons in the first swf, so the array will be created when any SWF will be loaded.
and the Error #1010: A term is undefined and has no properties. is out.
How I can stick to a certain SWF.
thanks in advance
|