Posted By

benwasilewski on 08/17/08


Tagged

display list actionscript debug debugging removing adding 3 as3 children


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

benwasilewski
tspitzr
toontitan


AS3: Get all children of specified object


 / Published in: ActionScript 3
 

This takes whatever object you want (called YOUR_OBJECT in the source) and traces out each child of that object. Pretty useful for debugging an add/removeChild issue.

  1. for (var i:uint = 0; i < YOUR_OBJECT.numChildren; i++)
  2. {
  3. trace ('\t|\t ' +i+'.\t name:' + YOUR_OBJECT.getChildAt(i).name + '\t type:' + typeof (YOUR_OBJECT.getChildAt(i))+ '\t' + YOUR_OBJECT.getChildAt(i));
  4.  
  5. }

Report this snippet  

You need to login to post a comment.