Skip to content

Instantly share code, notes, and snippets.

@mandarinx
Created April 30, 2012 08:54
Show Gist options
  • Save mandarinx/2556690 to your computer and use it in GitHub Desktop.
Save mandarinx/2556690 to your computer and use it in GitHub Desktop.
Remove all children (AS3)
while (this.numChildren > 0)
{
removeChild(this.getChildAt(0));
}
// Remove children as part of an event handler
private function eventHandler(e:Event):void
{
e.target.parent.removeChild(e.target);
}
// When using Flex
someObject.removeAllChildren();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment