/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Child index changed after you remove one. */ DisplayObject.prototype.removeAllChildren = function(){ for(var j = this.numChildren-1; j >= 0; j--){ this.removeChildAt(j); } } /* usage: movieClipName.removeAllChildren(); moviClipParent.movieClipChild.removeAllChildren(); etc. */