1 Reply Latest reply on Jun 25, 2010 5:06 PM by mattbanks82

    NetStream have users connect to eachother by only knowing one farID

    mattbanks82

      In the example you had to manually copy and paste the far ID's into the text boxes. Is there anyway you would only need to copy and paste one ID and the user on the other side could automaticly get the farID of the client trying to connect?

        • 1. Re: NetStream have users connect to eachother by only knowing one farID
          mattbanks82 Level 1

                      private function initSendStream():void{
                          var c:Object = new Object();
                          c.onPeerConnect = function(subscriber:NetStream):Boolean {
                              farPeerId = subscriber.farID;
                              initGetStream();
                              return true;
                          }   
                          sendStream = new NetStream(nc, NetStream.DIRECT_CONNECTIONS);
                          sendStream.addEventListener(NetStatusEvent.NET_STATUS, streamStatusHandle);
                          sendStream.publish("chat");
                          sendStream.client = c;                       
                      }
                     
                      private function initGetStream():void{
                          getStream = new NetStream(nc, farPeerId);
                          getStream.addEventListener(NetStatusEvent.NET_STATUS, streamStatusHandle)
                          getStream.play("chat");
                          getStream.client = this;
                      }

           

          I tried using this method, but on the output I get

           

          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start
          NetStream.Play.Reset
          NetStream.Play.Start