Server-Side Communication ActionScript > SharedObject.clear

 

SharedObject.clear

Availability

Flash Communication Server MX.

Usage

SharedObject.clear()

Parameters

None.

Returns

Returns true if successful; false otherwise.

Description

Method; deletes all properties and sends a "clear" event to all clients that subscribe to a persistent shared object. The persistent data object is also removed from persistent shared object. You can use SharedObject.clear to detach from a shared object immediately after SharedObject.get is invoked. You can use SharedObject.clear when you do not want to use a shared object anymore and want to remove it from the server completely. This method lets you create shared objects that persist only for a specified time.

Example

The following example calls the clear method on the shared object myShared:

var myShared = SharedObject.get("foo", true);
var len = myShared.clear();