I have a "box_mc" movieclip on the root of my stage and I need to select it from within my Document Class. I thought Stage.getChildByName("box_mc") would work, but it just returns null. Thanks in advance.
Asked
Active
Viewed 1,046 times
2 Answers
3
in your document class, in the constructor add
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
then in the function init:
private function init(e:Event):void
{
getChildByName("box_mc")
}

Allan
- 3,339
- 2
- 21
- 24
0
Well, assuming you're automatically declaring stage references (on by default, so unless you turned this off you're fine) then all you have to do is type box_mc.
In your document class constructor just type trace(box_mc) and it should work.

Myk
- 6,205
- 4
- 26
- 33