03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Parameters<br />

value:Object - One or more values to append to the array.<br />

Returns<br />

Number - An integer representing the length of the new array.<br />

Example<br />

The following example creates the array myPets_array with two elements, cat <strong>and</strong> dog. The<br />

second line adds two elements to the array.<br />

Because the push() method returns the new length of the array, the trace() statement in the<br />

last line sends the new length of myPets_array (4) to the Output panel.<br />

var myPets_array:Array = new Array("cat", "dog");<br />

var pushed:Number = myPets_array.push("bird", "fish");<br />

trace(pushed); // Displays 4.<br />

See also<br />

pop (Array.pop method), shift (Array.shift method), unshift (Array.unshift<br />

method)<br />

RETURNINDEXEDARRAY<br />

(Array.RETURNINDEXEDARRAY property)<br />

public static RETURNINDEXEDARRAY : Number<br />

Represents the option to return an indexed array as a result of calling the sort() or sortOn()<br />

method. You can use this constant for the options parameter in the sort() or sortOn()<br />

method. This provides preview or copy functionality by returning an array that represents the<br />

results of the sort <strong>and</strong> leaves the original array unmodified. The value of this constant is 8.<br />

See also<br />

sort (Array.sort method), sortOn (Array.sortOn method)<br />

reverse (Array.reverse method)<br />

public reverse() : Void<br />

Reverses the array in place.<br />

Example<br />

The following example uses this method to reverse the array numbers_array:<br />

240 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!