Its almost always a bad idea to remove something in an array when iterator is increasing.
Imagine, you have an array of 5 elements [e1, e2, e3, e4, e5]
when you cycle through all of them with
for (var i:int = 0; i < array.length; i++)
{
array.splice(i, 1);
}
you might assume you've erased all elements, but in fact what's really happening:
when i == 0, you erase first element (e1, with index 0), all other elements shift to the left
when i == 1, you erase third element e3 as second e2 shifted to index of 0 when you had used splice
so you've accessed only even elements
So, its much better to decrease i with i-- / --i , with for or while loop;
The most performant way to do so is:
var i:int = array.length;
while (i > 0)
{
--i;
// splice here
}