242
Chapter 6: ActionScript Core Classes
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.length
,
[] (array access)
Array.concat()
Availability
Flash Player 5.
Usage
my_array
.concat( [
value0:Object, value1,...valueN
])
: Array
Parameters
value0,...valueN
Numbers, elements, or strings to be concatenated in a new array. If you
don’t pass any values, a duplicate of
my_array
is created.
Returns
An array.
Description
Method; concatenates the elements specified in the parameters with the elements in
my_array
,
and creates a new array. If the
value
parameters specify an array, the elements of that array are
concatenated, rather than the array itself. The array
my_array
is left unchanged.
Example
The following code concatenates two arrays:
var alpha_array:Array = new Array("a","b","c");
var numeric_array:Array = new Array(1,2,3);
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...