Если вам нужен доступ ко всем детям, включая детей, вы можете попробовать это:
function doWhatever( mc:DisplayOjectContainer ):void
{
if( mc.numChildren > 0 )
for( var i:int ; i < mc.numChildren ; ++i )
{
//if you need to reposition
//set the points properties here
var point:Point = new Point( _x , _y );
setPosition ( mc.getChildAt(i ) , point );
//if you need to remove all children
//do it recursively
//remove( mc , mc.getChildAt( i );
}
}
function setPosition(mc:DisplayObject , point:Point ):void
{
mc.x = point.x ;
mc.y = point.y;
}
function remove(container:DisplayObjectContainer , child:DisplayObject ):void
{
//this will remove all children before being removed
if( child is DisplayObjectContainer )
{
var doc:DisplayObjectContainer = child as DisplayObjectContainer;
doWhatever( doc );
}
container.removeChild( child );
child = null;
}