Server-Side Communication ActionScript > SharedObject.resyncDepth

 

SharedObject.resyncDepth

Availability

Flash Communication Server MX.

Usage

SharedObject.resyncDepth

Description

Property; 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 Flash client. Suppose 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 could use SharedObject.resyncDepth to send a "clear" message, followed by a change message for two properties, which saves the client from receiving 10 delete messages.

Example

The following example resynchronizes the shared object mySO if the revision number difference is greater than 10:

mySo = SharedObject.get("foo");
mySo.resyncDepth = 10;