place loaded swf into movieciip
i´m trying to place a loader content (an swf which is an instance of the class "Nav") into a movieclip (so i can easily refer to its variables, for example, width) but when i trace the movieclip it throws null. why ?
Code:
private function doneNav(e:Event):void
{
trace (navLoader.content); // [Object Nav]. fine!
nav = navLoader.content as MovieClip; // null. why??
trace (navLoader.getChildAt(0)); // [Object Nav]. fine!
nav = navLoader.getChildAt(0) as MovieClip; // null. why??
i´d like to later in the code do this:
Code:
nav.x = (stage.stageWidth - nav.width)/2;
what are the best practices in loading swfs?
thanks!