I’m trying to access an init method I’ve set in one of my document level classes.
Container Movie loads Main Movie, which has Main.as as its document class, but I want to do a few things before I show the actual content. Here are some functions in Container.as:
public function moveLogo(e:TimerEvent):void{
loadTxt.visible = false;
var logoMoveUp:Tween = new Tween(logoCont, "y", Back.easeIn, 221, -250, 1, true);
logoMoveUp.addEventListener(TweenEvent.MOTION_FINISH, initMain);
}
public function initMain(e:TweenEvent){
addChild(loader.content);
**trace(loader.content); //returns [object Main]
trace(loader.content.init); //returns: 1119: Access of possibly undefined property init through a reference with static type flash.display:DisplayObject.**
}
If I trace e.currentTarget.content.init on my EVENT.COMPLETE callback function, I get “function Function()” like I should.