var so:SharedObject = SharedObject.getLocal("example");
var arr:Array=[1,2,3];
so.data.arr = arr;
so.flush();
trace(so.data.arr); // outputs 1,2,3
arr[2]=5;
trace(so.data.arr); // outputs 1,2,5
As you see, I updated only arr, but so.data.arr got updated as well.
so.data.arr doesn't update if instead of arr[2]=5; i write arr=[1,2,5];
Seems that arr and so.data.arr are linked somehow, but only if I update an element in the arr, not set the whole arr differently.
I discovered this accidentally. Why is it working like that?
Can I count that it works like that every time and use it? Thanks.