MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Manuale Utente Pagina 146

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 172
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 145
143
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
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();
SharedObject.resyncDepth
so.resyncDepth
An integer that indicates when the deleted properties of a shared object should be permanently deleted. You can use
this property in a server-side script to resynchronize shared objects and to control when shared objects are deleted.
The default value is infinity.
If the current revision number of the shared object minus the revision number of the deleted property is greater than
the value of
SharedObject.resyncDepth, the property is deleted. Also, if a client connecting to this shared object has
a client revision that, when added to the value of
SharedObject.resyncDepth, is less than the value of the current
revision on the server, all the current elements of the client shared object are deleted, the valid properties are sent to
the client, and the client receives a “clear” message.
This method is useful when you add and delete many properties and you don’t want to send too many messages to the
client. Suppose that a client is connected to a shared object that has 12 properties and then disconnects. After that client
disconnects, other clients that are connected to the shared object delete 20 properties and add 10 properties. When the
client reconnects, it could, for example, receive a delete message for the 10 properties it previously had and then a
change message on two properties. You can use
SharedObject.resyncDepth property to send a “clear” message,
followed by a change message for two properties, which saves the client from receiving 10 delete messages.
Availability
Flash Communication Server 1
Example
The following example resynchronizes the shared object so if the revision number difference is greater than 10:
Vedere la pagina 145
1 2 ... 141 142 143 144 145 146 147 148 149 150 151 ... 171 172

Commenti su questo manuale

Nessun commento