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

macromedia flash flashcom : still no answer


calmchess333
10/19/2006 2:59:30 PM
hi I have an array stored in a remote shared object except i don't know how to
get the array out of the remote shared object and use it. How do i get the
array and use it?.....what causes access.text = SO.data.slot0.array0[0];
......... to fail and display undefined?


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_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;

video conferencing
10/19/2006 3:15:21 PM
calmchess333
10/19/2006 3:53:56 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 4:05:47 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.
anonymous thing
10/20/2006 2:24:00 PM
for ( var i = 0; i < list.length; i++ )
trace("minsxxx:"+SO.data[list.name][0]);
}

what you want to try, in my view, is that : SO.data["slot0"][0]. I most warn
you that depending of your application, using complex data in a shared
object(object, array....) might slow down your app and increase the message
number and data send to users. If your application doesn't interact with a lot
of people you can continue on your way otherwise you should revise your
design(your code) to simplify properties in the SO like this example.

It is important to understand that when you updated a SO propertie ALL THE
DATA in this propertie is send to every SO connected user. If you look at the
example the good one will send only a number, string... and the bad one will
send a array of data. This can be a major problem.


[b]examples :[/b]

[b]Good[/b]
mySO [
firstProp: value;

secondProp: value;

....

]


[b]Will work but...[/b]

mySO [
firstProp : [minsxxx, secsxxx, .....]
secondProp: [...]
]


I hope this can help you and understand my poor English(I'm a French
developper).
calmchess333
10/20/2006 3:35:47 PM
AddThis Social Bookmark Button