I personally really like this way of clearing an array’s elements in ActionScript 3.

Declare your array to use:

var myArray:Array = new Array();

Add elements:

for (var i:Number = 0; i < 10; i++) {
  myArray[i] = "an item";
}

Clear the array:

myArray.length = 0;

Setting length to 0 is the quickest way to empty an array without creating a new one. It removes all elements in place, which means any other references to the same array will also see it as empty. This is usually what you want.

The alternative is myArray = new Array() or myArray = [], but that creates a new array object. If other parts of your code hold a reference to the original array, they won’t see the change. Use length = 0 when you need to clear in place, and reassignment when you want a fresh start.