Array Class - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Array class

Availability
Flash Player 5 (became a native object in Flash Player 6, which improved
performance significantly).
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
ActionScript Language Reference
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.
new Array()
) operator.
[]
CHAPTER 2
. To
Array class
103

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents