Clearing all objects in a display object container (DisplayObjectContainer) in Flash AS3 is very simple. Although AS3 does not provide a removeAllChild method for easy use, some programmers still use the removeChildAt() method provided to achieve the clearing of all objects. The method is also very simple. You can consider writing a static class to place the following code, as shown below:
// Clear all children
function removeAllChild(obj)
{
while(obj.numChildren)
obj.removeChildAt(0);
}