Thursday, 20 September 2012

as3 empty a movieclip

Say you have a movieclip that has either dynamically added children or objects you added in there before calling it to the stage and at some point you need to just empty it... start again....

Well I was  a little puzzled as to how to do that. However I did find this 3 liner and works a flipping treat!

for (var i:int = cliptoclear.numChildren - 1; i >= 0; i--) {

       cliptoclear .removeChildAt(i);
}


.

No comments: