Listing E.9 will connect the Flash client to a persistent remote SharedObject. If the object does not exist, it will be created. There is a simple read and write sample included.
initRemoteSharedObject = function () { trace("Connect a Remote SharedObject"); rem_so = SharedObject.getRemote("myRemoteSO", nc.uri, true); // Note: the following onSync event uses the onSync template script rem_so.onSync = onSyncTemplate; rem_so.connect(nc); // Write properties (slots) to the Remote SharedObject rem_so.data.simpleTest = "FlashCom will change the world!"; rem_so.data.arrayTest = ["Brett", "Mike", "Ryan", "Paul", "Jody", "Kevin"]; // Read properties (slots) from a Remote SharedObject var my_var = rem_so.data.test; var my_array = rem_so.data.arrayTest; trace(" Remote SharedObject Read Test: "+my_var); trace(" Remote SharedObject Read Test: "+my_array[0]); trace("Remote SO Size: "+rem_so.getSize()); };