Server-Side Communication ActionScript > SharedObject.unlock

 

SharedObject.unlock

Availability

Flash Communication Server MX.

Usage

mySharedObject.unlock()

Parameters

None.

Returns

An integer indicating the lock count: 0 or greater if successful, -1 otherwise. For proxied shared objects, this method always returns -1.

Description

Method; unlocks a shared object instance. This causes the script to relinquish exclusive access to the shared object and lets other clients update the instance. This method also causes the server to commit all changes made after the SharedObject.lock method is called and sends an update message to all clients.

You cannot use the SharedObject.unlock method on proxied shared objects.

Example

This example illustrates how easy it is to unlock a shared object.

var myShared = SharedObject.get("foo", true);
myShared.lock();
// insert code to manipulate the shared object
myShared.unlock();

See also

SharedObject.lock