Array Class | Flash 5; sortOn( ) method added in Flash 6 |
support for ordered lists of data |
new Array() new Array(len) new Array(element0, element1, element2,...elementn)
A nonnegative integer specifying the size of the new array.
A list of one or more initial values to be assigned as elements of the array.
The number of elements in an array (including empty elements).
Create a new array by appending additional elements to an existing array.
Convert the elements of an array to strings, and concatenate using a customizable delimiter.
Remove and return the last element of an array.
Add one or more elements to the end of an array.
Reverse the order of elements in an array.
Remove and return the first element of an array.
Create a new array using a subset of elements from an existing array.
Sort the elements of an array according to the specified rule.
Sort an array of objects by the specified property.
Remove elements from, and/or add elements to, an array.
Convert an array to a string of comma-separated element values.
Add one or more elements to the beginning of an array.
We use the properties and methods of the Array class to manipulate the data stored in the elements of an Array object. See Chapter 11 for exhaustive details on what arrays are and how you can use them, plus detailed definitions of the terminology used in this section. See also the [ ] and dot operators, which are used to access array elements and form array literals, as described in Chapter 5.
If the Array constructor is invoked with a single integer argument, that argument is used to set the length of the new array, which is then filled with undefined values. If two or more arguments are supplied to the constructor or if a single nonnumeric argument is supplied to the constructor, the arguments are used as the initial values for elements in the array, and the length of the array is determined by the number of arguments specified.