GIANNI INGUSCIO schrieb:
> Hi, I have a problem with a Remote Shared Object.
>
> I have created a Shared Object on the Red5 server, I have set some
> attributes.
> Now I want to access to Shared Object on client side. I tried this code but
> It doesn't print the attributes:
>
> var onlineSO:SharedObject = new SharedObject();
> onlineSO = SharedObject.getRemote("soList", nc.uri, false);
> onlineSO.connect(nc);
> for (var i in onlineSO.data)
> {
> trace(onlineSO.data[i].toString());
> }
>
> Do I have to write any code server side to access Shared Object from client
> side?
>
> Thanks, Gianni
>
try this code:
[code]
main_nc = new NetConnection();
main_nc.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace(info.code)
var onlineSO:SharedObject = new SharedObject();
onlineSO = SharedObject.getRemote("soList", nc.uri, true);
onlineSOo.onSync = function(list) {
trace(list.toString+"__list")
for (var n in list) {
var base_obj = this.data[list[n].name];
var base_obj_value = base_obj.<here_the_dataset_name>;
trace("Name: "+ var base_obj +"\n Value: "+var
base_obj_value+"\n___________");
//do something
}
};
drawing_so.connect(main_nc);
} else {
trace("ERROR: " + info.code);
}
};
main_nc.connect("rtmp:/<your_application>");
[/code]
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org