2011-02-01 46 views

回答

14

一个想法是,你可以写一个帮手功能,将为你做的工作。

public function getChildrenOf(target:DisplayObjectContainer):Array 
{ 
    var children:Array = []; 

    for (var i:uint = 0; i < target.numChildren; i++) 
     children.push(target.getChildAt(i)); 

    return children; 
} 
+2

注意,如果目标设置为`stage`,那么它将包含root,因为root是stage的子级。这可能会,也可能不是你想要的。 – sberry 2011-02-01 20:43:01