You can use the so almost like any other object in actionscript. So to add the box frame to it, you'd do something like:
Code:
function doChangeColor() {
if (ChangeColor_btn.getLabel() == "Blue") {
ChangeColor_btn.setLabel("Red");
_root.box.gotoAndStop(2);
so.data.boxFrame = 2;
} else if (ChangeColor_btn.getLabel() == "Red") {
ChangeColor_btn.setLabel("Blue");
_root.box.gotoAndStop(1);
so.data.boxFrame = 1;
}
}
So you stick values into the so's data object. To get them out you can either grab them whenever you want, or you can use the so's onSync method:
Code:
so.onSync = function(list) {
_root.box.gotoAndStop(so.data.boxFrame);
}
That should do it. Or you could use so.send which would work like so:
Code:
so.send("doColorChange",1);
The so.send will send the "1" and "doColorChange" to all the clients connected to the so. When they receive it they'll all call their own doColorChange function.
psx