View Full Version : Double nested dynamic mc's
Esseti
October 10th, 2009, 11:50 AM
Lets say I've created 10 dynamic MC's that have 10 dynamic MC's in each one. How can I address those nested MC's?
this.getChildAt("level1mc1").getChildAt("level2mc1"); - doesn't work
For some reason, Flash doesn't allow doubling this method.
_kp
October 10th, 2009, 12:40 PM
You probably mean getChildByName, not getChildAt ;)
Anyway it doesn't work because getChildAt/getChildByName returns an DisplayObject which can't have any childs.
Casting it to the desired class should work:
((MovieClip)this.getChildAt("level1mc1")).getChildAt("level2mc1 ");
or just don't make it a single line:
var l1mc1:MovieClip = this.getChildAt("level1mc1");
var l2mc1:MovieClip = l1mc1.getChildAt("level2mc1 ");
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.