banner
李大仁博客

李大仁博客

天地虽大,但有一念向善,心存良知,虽凡夫俗子,皆可为圣贤。

Clear all objects in the display object container in Flash AS3.

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);
}

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.