Shared Objects / array trouble

Hello,

I am having a spot of trouple with storing arrays in shared objects.

Here is an example of what I am trying to do.

http://users.tpg.com.au/marman/arrayTest.fla

The increase button populates an array (_root.ar_sm2), ie first time you press it 0,1 seccond time 0,1,1 thirs 0,1,1,1 you get the idea.

The save button stores the array in a shared object.

The load button recalls and displays the stored arrays in the text box.

The clear button sets all the nodes of _root.ar_sm2 to 0 for it’s length ie 0,0,0,0,0,0, whatever.

My problem is when you store the array to a shared object then clear _root.ar_sm2 the shared objects also gets cleared. Try increase, increase, increase, save, clear, load and you will see what I mean.

The reason I am doing this is to use the array to store how many objects I have on the stage ie attatchmovie. If I have 5 objects the array will read 0,1,1,1,1,1 and if I delete say object 3 (removemovieclip) it will then read 0,1,1,0,1,1. Then the user can save that array to a shared object (along with x and y coords for each item) clear the stage and reload it, or a different saved setting. Pretty neat huh?

I have written all the script for every thing else ie attatch and remove and it works perfectly so I don’t need assistance there it is just when I clear the array it also clears the shared object…

Any help as to why this is happening and also how I can prevent it would be appreciated.

Robert :kir: