1 Reply Latest reply on Nov 20, 2010 5:19 PM by Michael Thornburgh

    Using GroupSpecifier with NetStream to send handler to all users in Group

    director87

      I am testing some functionalities of cirrus but I have hit a bump. I've set up a groupspecifier that I use with netStream. Later I use netStream.send("handler",param) to try to update properties in the other clients connected to the group (e.g. one changes his background colour and it changes for the rest in the group).

       

      I am trying to avoid using object replication with netGroup.

       

      private function setupGroup():void{

       

      var groupspec:GroupSpecifier = new GroupSpecifier("vid"+GROUP_ID+"_sid_"+SESSION_ID);

      groupspec.serverChannelEnabled = true;

      groupspec.postingEnabled = true;

      groupspec.multicastEnabled = true;

      groupspec.ipMulticastMemberUpdatesEnabled = true;


       

      trace("Groupspec: "+groupspec.groupspecWithoutAuthorizations());

       


       

      ns = new NetStream(nc,groupspec.groupspecWithoutAuthorizations());

      ns.addEventListener(NetStatusEvent.NET_STATUS,netStatus);

      }

       

       

      Later I add a listener on a button that, when clicked:

       

      ns.send("changeSomthing", "000");

       

      My hope was that it sends this handler to the rest in the group, and as a result changes something with the param 000...

      Is my approach incorrect? Any help or suggestions would be appreciated. Thanks.