248
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 B Nina + Kathy + Cha Jane + Donna.
See also
[] array access operator
,
length (Array.length property)
CASEINSENSITIVE (Array.CASEINSENSITIVE
property)
public static CASEINSENSITIVE : Number
In the sorting methods, this constant specifies 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 Player 7
See also
sort (Array.sort method)
,
sortOn (Array.sortOn method)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...