Posted By

bshantz on 10/02/10


Tagged

display object as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

bobbym245
heathbo
dubogii


Remove All Children From Display Object


 / Published in: ActionScript 3
 

The cleanest and most compact way I\'ve seen to empty out a display object.

  1. private function removeAllChildren(target:DisplayObjectContainer):void
  2. {
  3. while(target.numChildren > 0) {
  4. target.removeChildAt(0);
  5. }
  6. }

Report this snippet  

You need to login to post a comment.