Movieclip Array Shared Objects

Hi,

I have managed to find enough on the web to create something that will save and load the position of a movieclip using shared objects but I was wondering if there was a way to do it so that I could save all the positions of the moveclips on stage in one shared object rather than writing one for each movieclip.

I’m guessing it can be done through an array but am getting muddled with what to do!

Here is the code for the single clip that works fine:

mySharedObject = SharedObject.getLocal(“savedObject”);
saveButton.onRelease = function() {
mySharedObject.data.myMCX = myMC._x;
mySharedObject.data.myMCY = myMC._y;
mySharedObject.flush();
};
loadButton.onRelease = function() {
myMC._x = mySharedObject.data.myMCX;
myMC._y = mySharedObject.data.myMCY;
};

And then here is the messed and muddled array:

mySharedObject = SharedObject.getLocal(“savedObject”);
saveButton.onRelease = function() {
mc1posx = my1MCX = my1MC._x;
mc1posy = my1MCY = my1MC._y;
mc2posx = my2MCX = my2MC._x;
mc2posy = my2MCY = my2MC._y;

dataArray = new Array (mc1posx,mc1posy,mc2posx,mc2posy);
mysharedObject.data.dataArray = dataArray;

mySharedObject.flush();
};
loadButton.onRelease = function() {
my1MC._x = mySharedObject.data.my1MCX;
my1MC._y = mySharedObject.data.my1MCY;
my2MC._x = mySharedObject.data.my2MCX;
my2MC._y = mySharedObject.data.my2MCY;
};

Any help greatly appreciated!