flash as3获得舞台的显示对象

代码如下:

testDisplayObject(stage);

function  testDisplayObject(doc:DisplayObjectContainer) 
{        
    
if  (doc.numChildren) 
    {
        trace(
" 当前对象 " ,doc, " 名字 " ,doc.name, " 下有 " ,doc.numChildren, " 个子显示对象\n " );
        
for  ( var  j: int = 0 ; j < doc.numChildren; j ++
        {
             trace(
" 分别是  " ,j, " : " ,doc.getChildAt(j), " \t名字是: " ,doc.getChildAt(j).name);
        }
        trace(
" \n\n\n " );
        
for  ( var  k: int = 0 ; k < doc.numChildren; k ++
        {         
             arguments.callee(doc.getChildAt(k));
        }
    } 
    
else  
    {
        trace(
" 当前对象 " ,doc, " 名字 " ,doc.name, " 下没有子显示对象了 " );
        }
}

 

 

转载于:https://www.cnblogs.com/sange/archive/2010/01/12/1645030.html

你可能感兴趣的:(flash as3获得舞台的显示对象)