actionscript 3 - AS3 Add array to another array -
example of problem.
var array_1:array = new array(); array_1[0] = [2,4,6,8]; var array_2:array = new array(); array_2[0] = [10,12,14,16]; array_2[1] = [18,20,22,24]; // , out come want trace(array_1[0]) // 2,4,6,8,10,12,14,16,20,22,24 // did try array_1[0] += array_2[0] didn't work
any suggestion great.
this perform looking , allows add multiple rows of data array_1
or array_2
var array_1:array = new array(); array_1[0] = [2,4,6,8]; var array_2:array = new array(); array_2[0] = [10,12,14,16]; array_2[1] = [18,20,22,24]; var combinedarray:array = new array(); for( var i:int = 0; < array_1.length; i++ ) { combinedarray = combinedarray.concat(array_1[i]); } for( = 0; < array_2.length; i++ ) { combinedarray = combinedarray.concat(array_2[i]); } trace(combinedarray);
Comments
Post a Comment