Browse or list the children of a movieclip or a DisplayObject using flash as3 getChildAt
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/** * @uso var miArray:Array =getNumChilds(miObject); * @param1 $obj Object, Display Object * @retorna Array */ function getNumChilds(obj:*):Array { var childs:Array = []; for (var c = 0; c < obj.numChildren; c++) { childs.push(obj.getChildAt(c) ); } return childs; } trace(getNumChilds(miObject).length); |
One comment on “AS3 – Snippet – MC – Recorrer o listar los hijos de un movieclip u objetos displayObject mediante getChildAt con flash as3”
Otra version mejorada
http://jvm.bricobit.com/as3-snippet-recorrer-todos-los-objetos-movieclips-y-sus-profundidades-hijos-del-escenario-o-de-un-movieclip/