Push (Array.push Method); Returnindexedarray (Array.returnindexedarray Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

push (Array.push method)

public push(value:Object) : Number
Adds one or more elements to the end of an array and returns the new length of the array.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- One or more values to append to the array.
value:Object
Returns
- An integer representing the length of the new array.
Number
Example
The following example creates the array
with two elements,
and
. The
myPets_array
cat
dog
second line adds two elements to the array.
Because the
method returns the new length of the array, the
statement in the
push()
trace()
last line sends the new length of
(
) to the Output panel.
myPets_array
4
var myPets_array:Array = new Array("cat", "dog");
var pushed:Number = myPets_array.push("bird", "fish");
trace(pushed); // Displays 4.
See also
,
,
pop (Array.pop method)
shift (Array.shift method)
unshift (Array.unshift
method)
RETURNINDEXEDARRAY
(Array.RETURNINDEXEDARRAY property)
public static RETURNINDEXEDARRAY :
Number
Represents the option to return an indexed array as a result of calling the
or
sort()
sortOn()
method. You can use this constant for the
parameter in the
or
options
sort()
sortOn()
method. This provides preview or copy functionality by returning an array that represents the
results of the sort and leaves the original array unmodified. The value of this constant is 8.
Availability: ActionScript 1.0; Flash Lite 2.0
See also
,
sort (Array.sort method)
sortOn (Array.sortOn method)
Array
257

Advertisement

Table of Contents
loading

Table of Contents