Array class
Availability
Flash Player 5.
Description
The Array class lets you access and manipulate arrays. An array is an object whose properties are
identified by a number representing their position in the array. This number is referred to as the
index. All arrays are zero-based, which means that the first element in the array is [0], the second
element is [1], and so on. To create an Array object, you use the constructor
access the elements of an array, you use the array access (
In the following example,
var my_array:Array = new Array();
my_array[0] = "January";
my_array[1] = "February";
my_array[2] = "March";
my_array[3] = "April";
Method summary for the Array class
Method
Array.concat()
Array.join()
Array.pop()
Array.push()
Array.reverse()
Array.shift()
Array.slice()
Array.sort()
Array.sortOn()
Array.splice()
Array.toString()
Array.unshift()
Property summary for the Array class
Property
Array.length
240
Chapter 6: ActionScript Core Classes
contains four months of the year:
my_array
Description
Concatenates the parameters and returns them as a new array.
Joins all elements of an array into a string.
Removes the last element of an array and returns its value.
Adds one or more elements to the end of an array and returns the array's new
length.
Reverses the direction of an array.
Removes the first element from an array and returns its value.
Extracts a section of an array and returns it as a new array.
Sorts an array in place.
Sorts an array according to a field in the array.
Adds and removes elements from an array.
Returns a string value representing the elements in the Array object.
Adds one or more elements to the beginning of an array and returns the array's
new length.
Description
A non-negative integer specifying the number of elements in the array.
ActionScript Core Classes
new Array()
) operator.
[]
CHAPTER 6
. To
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?