Write a method that SharedObject.send() will call:
Last updated on
Apr 27, 2021
A remote shared object allows either a client or server to send a message using SharedObject.send() to all clients connected to the shared object. The send() method can be used for text chat applications, for example, where all users subscribed to your shared object receive your message.
When you use SharedObject.send(), you, as broadcaster, also receive a copy of the message.
-
private function doSomething(msg:String):void { trace("Here's the message: " + msg); }
-
Call send() to broadcast the message:
so = SharedObject.getRemote("position", nc.uri, false); so.connect(nc); so.send("doSomething", msg);