Array.push() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Array.push()

Availability
Flash Player 5.
Usage
my_array.push(value,...) : Number
Parameters
One or more values to append to the array.
value
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()
Output panel.
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(),
110
Chapter 2: ActionScript Language Reference
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
and
. The
dog
(
) to the
4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents