User Guide
252 ActionScript classes
if (my_array[0] == undefined) { // No quotation marks around undefined.
trace("undefined is a special value, not a string");
} // Traces: undefined is a special value, not a string.
Usage 3: The following example creates the new Array object go_gos_array with an initial
length of 5:
var go_gos_array:Array = new Array("Belinda", "Gina", "Kathy", "Charlotte",
"Jane");
trace(go_gos_array.length); // Returns 5.
trace(go_gos_array.join(", ")); // Displays elements.
The initial elements of the go_gos_array array are identified, as shown in the following
example:
go_gos_array[0] = "Belinda";
go_gos_array[1] = "Gina";
go_gos_array[2] = "Kathy";
go_gos_array[3] = "Charlotte";
go_gos_array[4] = "Jane";
The following code adds a sixth element to the go_gos_array array and changes the second
element:
go_gos_array[5] = "Donna";
go_gos_array[1] = "Nina"
trace(go_gos_array.join(" + "));
// Returns Belinda + Nina + Kathy + Charlotte + Jane + Donna.
See also
[] array access operator, length (Array.length property)
CASEINSENSITIVE (Array.CASEINSENSITIVE
property)
public static CASEINSENSITIVE : Number
Represents case-insensitive sorting. You can use this constant for the options parameter in
the
sort() or sortOn() method. The value of this constant is 1.
Availability: ActionScript 1.0; Flash Lite 2.0
See also
sort (Array.sort method), sortOn (Array.sortOn method)
concat (Array.concat method)
public concat([value:Object]) : Array