MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 93

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 92
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
90
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 or 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()
so.purge(version)
Causes the server to remove all deleted properties that are older than the specified version. Although you can also
accomplish this task by setting the
SharedObject.resyncDepth property, the purge() method gives the script
more control over which properties to delete.
Availability
Flash Communication Server 1
Parameters
version A number indicating the version. All deleted data that is older than this version is removed.
Returns
A boolean value.
Example
The following example deletes all the properties of the
so shared object that are older than the value of so.version
- 3:
var so = SharedObject.get("foo", true);
so.lock();
so.purge(so.version - 3);
so.unlock();
Vedere la pagina 92
1 2 ... 88 89 90 91 92 93 94 95 96 97 98 ... 154 155

Commenti su questo manuale

Nessun commento