I need help badly, I’ve tried to google this several times with no luck.
I’m loading in an external swf with the code below (which works great), but occasionally I need to clear out “gameHolder” with a call of “removeChild(gameHolder);” but it doesn’t work. I believe it is because the contents of “gameHolder” is a displayObject instead of a movieClip.
Any help would be greatly appreciated.
function load_game()
{
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest("game.swf");
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
}
}
function onCompleteHandler(loadEvent:Event)
{
gameHolder = addChild(loadEvent.currentTarget.content);
gameHolder.addEventListener( "gameFinished", finishEventReceived, false, 0, true );
}