Posted By

okhy on 09/14/11


Tagged

display object remove all num children completely


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

captiv8tor


removeAllChildren


 / Published in: ActionScript 3
 

  1. /*
  2.   Child index changed after you remove one.
  3. */
  4. DisplayObject.prototype.removeAllChildren = function(){
  5. for(var j = this.numChildren-1; j >= 0; j--){
  6. this.removeChildAt(j);
  7. }
  8. }
  9.  
  10. /*
  11.  
  12. usage:
  13. movieClipName.removeAllChildren();
  14. moviClipParent.movieClipChild.removeAllChildren();
  15. etc.
  16.  
  17. */

Report this snippet  

You need to login to post a comment.