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.

  1. Write a method that SharedObject.send() will call:

     private function doSomething(msg:String):void { 
         trace("Here's the message: " + msg); 
     }
  2. Call send() to broadcast the message:

     so = SharedObject.getRemote("position", nc.uri, false); 
     so.connect(nc);  
     so.send("doSomething", msg);

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy