retrieve all children contained within a movieclip
AS3 October 8th, 2008Code snipplet to retieve all children contained within a movie clip:
Actionscript:
-
public function getAllChildren(target_mc):Array {
-
var childrenArray:Array = new Array;
-
for (var i:uint = 0; i <target_mc.numChildren; i++){
-
//trace ('\t|\t ' +i + '.\t name:' + target_mc.getChildAt(i).name + '\t type:' + typeof (target_mc.getChildAt(i)) + '\t' + target_mc.getChildAt(i));
-
childrenArray.push(target_mc.getChildAt(i));
-
-
}
-
return childrenArray;
-
}