I am trying to access the properties of a "GrandChild" MovieClip.
My DocumentClass adds an instance ("_parent") of the DisplayObject (linked from the library) to the stage:
I have a separate class that takes care of all the "_parent" related stuff, which is where I run into the problem. In this class, within a public function, I create a new instance of a movieclip and add it as a child to the parent. Then I add a child to the _child, aka a "grandchild"....all within a loop, and set some properties of the grandchild, like so:PHP Code:addChild(_parent);
Now, I am unable to "see" the grandchild's properties outside the loop. What's the proper way to get to the grandchild's properties? I've tried variations of the following:PHP Code:for (i=1; i < 5; i++){
var _child:MovieClip = new MovieClip;
var _grandchild:MovieClip = new MovieClip;
_parent.addChild(_child);
_child.addChild(_grandchild);
_grandchild.x = i;}
Thanks,PHP Code:trace(_parent.getChildAt(1).getChildAt(1).x);
trace(_parent._child.getChildAt(0).x);




Reply With Quote
