Skip to main content
Inspiring
September 11, 2006
Question

Remote Shared Object

  • September 11, 2006
  • 1 reply
  • 196 views
Hi....i created this script hoping that i could create a remote shared object but when i look in the flash media server 2 admin console under the shared objects catagorey I see the connection but I don't see the object.
Is something wrong with the code?
I'm new to flash and if you would correct the code i'd appreciate it.
BTW i'd like the simplest remote shared object possible....if you feel like writing a remote shared object i'd appreciate it.




my_nc = new NetConnection();
my_nc.connect("rtmp:/development");
//
function initRSO(){
my_rso = SharedObject.getRemote("myRSO", my_nc.uri, true);
//
my_rso.data.someVariable="this value";
trace("value is: " + my_rso.data.SomeVariable);
//
my_rso.connect(my_nc);
}

my_nc.onStatus = function(info) {
if (info.code == "netConnection.Connect.Success"){
initRSO();
}
};
    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Inspiring
    September 11, 2006
    maybe your trace was called before the updates in SO has be made. Try this after your getRemote() method:

    my_rso.prototype.onSync = function (list) {
    writeln("SharedObject.prototype.onSync");
    if (!this.synchronized) {
    writeln("This shared object has been synchronized.");
    this.synchronized = true;
    }
    for (var i in list) { // Loop through all the objects in the array.
    writeln("------------------");
    var info = list ; // Get the object at position i in the array.
    for (var p in info) { // Loop through all the properties of the object.
    writeln("i: " + i + ", " + p + ": " + info

    );
    if (p == "oldValue") { // If a value changed, show the new one too.
    writeln("newValue: " + this.data[info.name]);
    }
    }
    }
    };

    the onSync event is called after all changes in SharedObject. I hope that's all....