var ary:Array = ["string","string","string"];
var copy_ary:Array = ary;
trace(copy_ary);//string,string,string
ary[1]=false;
trace(copy_ary);//string,false,string
All I want to do is make a copy of the array ary without the copy constantly changing in accordance with the original. Would I have to create a copy with a loop (e.g. below)?
var ary:Array = ["string","string","string"];
var copy_ary:Array = [];
for(var i=0;i<ary.length;i++){
copy_ary[i]=ary[i];
}
Obviously this works, but it seems a lot of work considering one wouldn't think the copied array would constantly stay the same as the original in the first place. Could someone please tell me why this is?