var array:Array = []; var length:int = array.length; while (length-- > 0) { if (array[length] == null) { array.splice(length, 1); } }