/ Published in: ActionScript 3
Expand |
Embed | Plain Text
function removeChildrenFrom(mc:MovieClip):void { if(mc.numChildren!=0) { var i:int = mc.numChildren; while(i --) { mc.removeChildAt(i); } } }
Comments
Subscribe to comments
You need to login to post a comment.

How about
[code] function removeChildremFrom(mc:MovieClip):void { while(mc.numChildre != 0) mc.removeChildAt(0); } [/code]
@JorRy Much better
@JorRy Nice, cleaner to take out that extra if statement :)