Posted By


okhy on 09/14/11

Tagged


Statistics


Viewed 476 times
Favorited by 0 user(s)

removeAllChildren


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



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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.