EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - NUMERIC (Array.numeric Property); Pop (Array.pop Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
256 ActionScript classes
my_array.length = 5;
trace(my_array.length); // my_array.length is updated to 5
trace(my_array); // outputs: a,b,undefined,undefined,undefined
NUMERIC (Array.NUMERIC property)
public static NUMERIC : Number
Represents numeric sorting instead of string-based sorting. String-based sorting, which is the
default setting, treats numbers as strings when sorting them. For example, string-based sorting
places 10 before 3. A numeric sort treats the elements as numbers so that 3 will be placed
before 10. You can use this constant for the
options parameter in the sort() or sortOn()
method. The value of this constant is 16.
Availability: ActionScript 1.0; Flash Lite 2.0
See also
sort (Array.sort method), sortOn (Array.sortOn method)
pop (Array.pop method)
public pop() : Object
Removes the last element from an array and returns the value of that element.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
Object - The value of the last element in the specified array.
Example
The following code creates the array
myPets_array array containing four elements, and then
removes its last element:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
var popped:Object = myPets_array.pop();
trace(popped); // Displays fish.
trace(myPets_array); // Displays cat,dog,bird.
See also
push (Array.push method), shift (Array.shift method), unshift (Array.unshift
method)

Table of Contents

Related product manuals