Remove All Children – Important Classes for games in AS 3.0

December 22nd, 2011 by aabhaanjan

images

[xml]
package
{

import flash.display.MovieClip;
/**
* …
* @description : This Class can be used when you need to remove all the childern of a parent movieClip.
* @author Aava Rani
*/
public class RemoveAllChildClass extends MovieClip
{

public function RemoveAllChildClass():void
{
trace(‘ Constructor called ‘);
}

public function removeAllChild(__parent:MovieClip):void {
if(__parent.numChildren!=0){
var __i:int = __parent.numChildren;
while(__i — )
{
__parent.removeChildAt( __i );
}
}
}

}

}
[/xml]