
Server-Side Communication ActionScript 53
SharedObject.flush
Availability
Flash Communication Server MX.
Usage
SharedObject.flush()
Parameters
None.
Returns
A Boolean value of true if successful, false otherwise.
Description
Method; causes the server to save the current state of the shared object instance. The shared object
must have been created with the persistence option.
Example
The following example places a reference to the shared object foo in the variable myShared. It
then locks the shared object instance so that no one can make any changes to it, and then saves
the shared object by calling
myShared.flush. After the shared object is saved, it is unlocked so
that further changes can be made.
var myShared = SharedObject.get("foo", true);
myShared.lock();
// insert code here that operates on the shared object
myShared.flush();
myShared.unlock();
SharedObject.get
Availability
Flash Communication Server MX.
Usage
SharedObject.get(name, persistence [, netConnection])
Parameters
name Name of the shared object instance to return.
persistence A Boolean value: true for a persistent shared object; false for a nonpersistent
shared object. If no value is specified, the default value is
false.
netConnection A NetConnection object that represents a connection to an application
instance. You can pass this parameter to get a reference to a shared object on another server or a
shared object that is owned by another application instance. All update notifications for the
shared object specified by the
name parameter are proxied to this instance, and the remote
instance notifies the local instance when a persistent shared object changes. The NetConnection
object that is used as the
netConnection parameter does not need to be connected when you call
SharedObject.get. The server connects to the remote shared object when the NetConnection
state changes to connected. This parameter is optional.
Returns
A reference to a shared object instance.
Komentáře k této Příručce