splice( ) returns a new array containing the deleted elements
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var letters:Array = ["a", "b", "c", "d"];
var deleted:Array = letters.splice(0, 2);
for (var i:int = 0; i < deleted.length; i++) {
trace(deleted[i]);
}
}
}
}
Related examples in the same category