User Guide

Array.slice() 247
Array.shift()
Availability
Flash Player 5.
Usage
my_array.shift() : Object
Parameters
None.
Returns
The first element in an array.
Description
Method; removes the first element from an array and returns that element.
Example
The following code creates the array myPets_array and then removes the first element from the
array and assigns it to the variable
shifted:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
var shifted:String = myPets_array.shift();
trace(shifted); // displays "cat"
trace(myPets_array); // displays dog,bird,fish
See also
Array.pop()
, Array.push(), Array.unshift()
Array.slice()
Availability
Flash Player 5.
Usage
my_array.slice( [ start:Number [ , end:Number ] ] ) : Array
Parameters
start
A number specifying the index of the starting point for the slice. If start is a negative
number, the starting point begins at the end of the array, where -1 is the last element.
end A number specifying the index of the ending point for the slice. If you omit this parameter,
the slice includes all elements from the starting point to the end of the array. If
end is a negative
number, the ending point is specified from the end of the array, where -1 is the last element.
Returns
An array.