Return to Snippet

Revision: 32815
at October 2, 2010 13:40 by bshantz


Updated Code
private function removeAllChildren(target:DisplayObjectContainer):void
{
	while(target.numChildren > 0) {
		target.removeChildAt(0);
	}
}

Revision: 32814
at October 2, 2010 13:39 by bshantz


Initial Code
private function removeAllChildren(target:DisplayObjectContainer):void
		{
			while(target.numChildren > 0) {
				target.removeChildAt(0);
			}
		}

Initial URL


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

Initial Title
Remove All Children From Display Object

Initial Tags
object

Initial Language
ActionScript 3