AS3: Get all children of specified object


/ Published in: ActionScript 3
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.