User Guide
SharedObject class 127
SharedObject.handlerName
Availability
Flash Communication Server MX 1.0.
Usage
mySO.onBroadcastMsg = function([p1,..., pN]){}
Parameters
onBroadcastMsg A property name.
p1, ..., pN Optional parameters passed to the handler method if the message contains
user-defined parameters. These parameters are the user-defined JavaScript objects passed to
the
SharedObject.send method.
Returns
Any return value is ignored by the server.
Description
Event handler; a placeholder for an event handler (onBroadcastMsg in the Usage example
above); the handler is invoked when a shared object receives a broadcast message with the
same name.
You must define a function object and assign it to the event handler. A shared
object can receive a broadcast message from the client-side
SharedObject.send() method.
The
this keyword used in the body of the function is set to the shared object instance
returned by
SharedObject.get().
If you don’t want the server to receive a particular broadcast message, do not define this
handler.
Example
The following example defines a function called broadcastMsg:
var mySO = SharedObject.get("userList", false);
mySO.broadcastMsg = function(msg1, msg2){
trace(msg1 + " : " + msg2);
};