130
Server-Side ActionScript Language Reference
p1, ..., pN
Parameters of any ActionScript type, including references to other
ActionScript objects. These parameters are passed to the specified handler when it is executed
on the Flash client.
Returns
A Boolean value. Returns
true
if the message can be dispatched to the client;
false
otherwise.
Description
Method; delivers all
change
events to a subscribing client as a single message.
In a server-side script, you can call the
setProperty()
method to update multiple shared
object properties between a call to the
lock()
and
unlock()
methods. All subscribing clients
receive a
change
event notification through the
SharedObject.onSync
handler. However,
because the server may collapse multiple messages to optimize bandwidth, the
change
event
notifications might not be sent in the same order as they were in the code.
Use the
mark()
method when you want to execute code after all the properties in a set have
been updated.
If an application calls the
lock()
method to lock a shared object, calls the
setProperty()
method to make a series of property changes, and calls the
mark()
method before calling the
unlock()
method, Flash Media Server guarantees that all the
change
events are delivered to
the subscribing clients as a single message. You can call the
handlerName
parameter passed to
the
mark()
method knowing that all property changes before the
mark()
call have been
updated.
Example
The following example calls the
mark()
method twice to group two sets of shared object
property updates for clients:
var myShared = SharedObject.get("foo", true);
myShared.lock();
myShared.setProperty("name", "Stephen");
myShared.setProperty("address", "Xyz lane");
myShared.setProperty("city", "SF");
myShared.mark("onAdrChange", "name");
myShared.setProperty("account", 12345);
myShared.mark("onActChange");
myShared.unlock();