You are not logged in.
Flash Shared Objects 101:
When making a flash save game, NEVER do this:
mySO = SharedObject.getLocal('Foo');
mySO.data.some_array=some_array;
If you do, the shared object contains a REFERENCE to the array, and the shared object will change as the game changes the array. So you go save your game, run the game, then some stuff that happened in your game now sticks in the savefile even though you didn't save again.
Instead do this:
function copy_object(src)
{
if (typeof(src)!="object")
{
return src;
}
var dest=new src.__proto__.constructor();
for (var v in src)
{
dest[v]=copy_object(src[v]);
}
return dest;
}
then use it like this:
mySO = SharedObject.getLocal('Foo');
mySO.data.some_array=copy_object(some_array);
No matter what type you are using, it will save it correctly.
This is for Ationscript 1.x and 2.x, not sure about behavior for AS3.
"We are merely sprites that dance at the beck and call of our button pressing overlord."
Offline