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.

trace(my_array); // outputs: a,b,undefined,undefined,undefined<br />

NUMERIC (Array.NUMERIC property)<br />

public static NUMERIC : Number<br />

Represents numeric sorting instead of string-based sorting. String-based sorting, which is the<br />

default setting, treats numbers as strings when sorting them. For example, string-based sorting<br />

places 10 before 3. A numeric sort treats the elements as numbers so that 3 will be placed<br />

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

method. The value of this constant is 16.<br />

See also<br />

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

pop (Array.pop method)<br />

public pop() : Object<br />

Removes the last element from an array <strong>and</strong> returns the value of that element.<br />

Returns<br />

Object - The value of the last element in the specified array.<br />

Example<br />

The following code creates the array myPets_array array containing four elements, <strong>and</strong> then<br />

removes its last element:<br />

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

var popped:Object = myPets_array.pop();<br />

trace(popped); // Displays fish.<br />

trace(myPets_array); // Displays cat,dog,bird.<br />

See also<br />

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

method)<br />

push (Array.push method)<br />

public push(value:Object) : Number<br />

Adds one or more elements to the end of an array <strong>and</strong> returns the new length of the array.<br />

Array 239

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

Saved successfully!

Ooh no, something went wrong!