
60
Example
The following example creates a function that is invoked whenever a property of the shared object
so changes:
// create a new NetConnection object
nc = new NetConnection();
nc.connect("rtmp://server1.xyx.com/myApp");
// create the shared object
so = SharedObject.get("MasterUserList", true, nc);
// the list parameter is an array of objects containing information
// about successfully of unsuccessfully changed properties
// from the last time onSync() was called
so.onSync = function(list) {
for (var i = 0; i < list.length; i++) {
switch (list[i].code ) {
case "success":
trace ("success");
break;
case "change":
trace ("change");
break;
case "reject":
trace ("reject");
break;
case "delete":
trace ("delete");
break;
case "clear":
trace ("clear");
break;
}
}
};
SharedObject.purge
Availability
Flash Communication Server MX.
Usage
SharedObject.purge(version)
Parameters
version A version number. All deleted data that is older than this version is removed.
Returns
Nothing.
Description
Method; causes the server to purge all deleted properties that are older than the specified version.
Although you can also accomplish this task by setting the
SharedObject.resyncDepth property,
the
SharedObject.purge method gives the script more control over which properties to delete.
Commentaires sur ces manuels