var alphaNumeric_array:Array =alpha_array.concat(numeric_array);
trace(alphaNumeric_array);
// creates array [a,b,c,1,2,3]
The following code concatenates three arrays:
var num1_array:Array = [1,3,5];
var num2_array:Array = [2,4,6];
var num3_array:Array = [7,8,9];
var nums_array:Array=num1_array.concat(num2_array,num3_array)
trace(nums_array);
// creates array [1,3,5,2,4,6,7,8,9]
Nested arrays are not flattened in the same way as normal arrays. The elements in a nested array
are not broken into separate elements in array
var a_array:Array = new Array ("a","b","c");
// 2 and 3 are elements in a nested array
var n_array:Array = new Array(1, [2, 3], 4);
var x_array:Array = a_array.concat(n_array);
trace(x_array[0]); // a
trace(x_array[1]); // b
trace(x_array[2]); // c
trace(x_array[3]); // 1
trace(x_array[4]); // 2, 3
trace(x_array[5]); // 4
Array.join()
Availability
Flash Player 5.
Usage
my_array.join([separator:String]) : String
Parameters
A character or string that separates array elements in the returned string. If you omit
separator
this parameter, a comma (,) is used as the default separator.
Returns
A string.
Description
Method; converts the elements in an array to strings, inserts the specified separator between the
elements, concatenates them, and returns the resulting string. A nested array is always separated
by a comma (,), not by the separator passed to the
, as shown in the following example:
x_array
method.
join()
Array.join()
243
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?