Returns
An integer representing the length of the new array.
Description
Method; adds one or more elements to the end of an array and returns the array's new length.
Example
The following example creates the array
second line adds two elements to the array. Because the
the array, the
trace()
log file.
var myPets_array:Array = new Array("cat", "dog");
var pushed:Number = myPets_array.push("bird", "fish");
trace(pushed); // displays 4
See Also
,
Array.pop()
Array.shift()
Array.reverse()
Availability
Flash Player 5.
Usage
my_array.reverse() : Void
Parameters
None.
Returns
Nothing.
Description
Method; reverses the array in place.
Example
The following example uses this method to reverse the array
var numbers_array:Array = new Array(1, 2, 3, 4, 5, 6);
trace(numbers_array); // displays 1,2,3,4,5,6
numbers_array.reverse();
trace(numbers_array); // displays 6,5,4,3,2,1
246
Chapter 6: ActionScript Core Classes
myPets_array
statement in the last line sends the new length of
,
Array.unshift()
with two elements,
cat
method returns the new length of
push()
myPets_array
:
numbers_array
and
. The
dog
(
) to the
4
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?