ActionScript 3 Working With Display Objects Remove all objects from the display list


Example

If targeting Flash Player 11+, the built-in removeChildren method is the best way to remove all children:

removeChildren(); //a start and end index can be passed 

For legacy applications, the same can be accomplished with a loop:

while (numChildren > 0) {
    removeChildAt(0);
}