var firstArray : Array = new Array(0,1,2,3,4,5);
var secondArray : Array;
secondArray = firstArray;
Creates an additional reference to the array.
var firstArray : Array = new Array(0,1,2,3,4,5);
var secondArray : Array;
System.Array.Copy(firstArray, secondArray, firstArray.length);
No appropriate version of ‘System.Array.Copy’ for the argument list ‘(Array, Array, int)’ was found.
How to use System.Array? Where can I read about it? How to clone array?
I don't use Javascript but I think Array.Copy only accepts bracket arrays (int[], etc.). It works if you declare your array like this: var fArray : int[] = [0,1,2,3,4,5]; var sArray : int[]; function Start () { //Receiving array must be resized first sArray = new int[fArray.length]; System.Array.Copy(fArray, sArray, fArray.length); } If you really want to use 'Array' type then you can manually iterate through the array and set each value.
– Josh707Thank you. It work, but now is too much Array's in code.
– Kademn