Groups | Blog | Home
all groups > macromedia flash flashcom > october 2006 >

macromedia flash flashcom : RSO Array



calmchess333
10/18/2006 6:38:20 PM
JayCharles
10/18/2006 11:10:59 PM
Let's assume your array is saved in an SO property named "myArray"

On the client side

myArray = my_so.data.myArray;

or

myVar = my_so.data.myArray[x];

on the server side:

myArray = my_so.getProperty("myArray");
myVar = myArray[x];


calmchess333
10/19/2006 3:09:44 AM
well that doesn't work....here is how i attempt to access the array using the
method you mentioned below.....SO.data.slot0.theTime[0]; ........but that
always traces as undefined but if i trace....... SO.data.slot0; .....then the
array displays just fine but i can't access its data.
calmchess333
10/19/2006 4:26:25 AM
here is the code i'm attempting to use.

client_nc = new NetConnection();
client_nc.onStatus = function(info) {
trace("Level: " + info.level + newline + "Code: " + info.code);
}
client_nc.connect("rtmp:/RSO");
SO = SharedObject.getRemote("data0", client_nc.uri, false);
SO.connect(client_nc);
SO.onSync = function(list) {

for ( var i = 0; i < list.length; i++ )
if ( list[i].name == "slot0" && list[i].code != "success")
{
array0 = SO.data.slot0;
break;
}
};
//start timer
start_btn.onPress = addarray;
function addarray() {
SO.data.slot0 = array0;
slot0.text = SO.data.slot0;
access.text = SO.data.slot0.array0[0];
}
var array0 = new Array();
var minsxxx = 1;
var secsxxx = 2;
array0[0] = minsxxx;
array0[1] = secsxxx;

calmchess333
10/19/2006 4:52:22 PM
I fixed it I fixed it.........for some reason 1 slot of the stored array was in
.....SO.data.slot[0]....and the other slot of the stored array was in
SO.data.slot[1].....i'm a little baffled so i'll just call this unkown work
around.
JayCharles
10/19/2006 4:55:48 PM
calmchess333
10/19/2006 6:07:10 PM
slot0 is the name of the slot in the remote shared object i wish to use...in
case i want to store somthing else in slot1 or slot2 or whatever a remote
shared object is similar to an array in the way it stores information.....in my
case a slot in an array storing an array.
calmchess333
10/19/2006 6:10:24 PM
AddThis Social Bookmark Button