3 Replies Latest reply on Feb 5, 2010 2:22 AM by suxuekun

    Stratus connection problem?

    satheeshpallath12 Level 1

      Hai,

       

       

      error:   1061: Call to a possibly undefined method Connect through a reference with static type flash.net:NetConnection.    connection/src    connection.mxml    line 18    1265363716410    76


      1120: Access of undefined property DeveloperKey.    connection/src    connection.mxml    line 18    1265363716410    77

       

       

       

      This is what i got when

      i coded.....

       

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="connect()">
         
          <mx:Script>
              <![CDATA[
              import flash.events.NetStatusEvent;
              import flash.net.NetConnection;
              import mx.controls.Alert;   
                 
              private const StratusAddress:String = "rtmfp://stratus.adobe.com";
              private const developerKey:String = "4423df5893dcbe33c8e5fe75-e866dfa19977";
              private var nc : NetConnection;
             
              private function connect():void
              {
                  nc = new NetConnection;
                  nc.addEventListener(NetStatusEvent.NET_STATUS, netConnectionHandler);
                  nc.Connect(StratusAddress + "/" + DeveloperKey);
              }
             
              private function netConnectionHandler(event:NetStatusEvent):void
              {
                  Alert.show(event.info.code,"infocode");
                  //Alert.show(nc.nearID,"peerID");
              }
             
              ]]>
          </mx:Script>
          <mx:Button x="335" y="238" label="Connect" click="connect" id="conn"/>
         
         
      </mx:Application>

        • 1. Re: Stratus connection problem?
          suxuekun Level 1

          nc.connect

          not

          nc.Connect

           

          not upper case!...

          • 2. Re: Stratus connection problem?
            suxuekun Level 1

            <?xml version="1.0" encoding="utf-8"?>

            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

            creationComplete="connect()">

             

                <mx:Script>

                    <![CDATA[

                    import flash.events.NetStatusEvent;

                    import flash.net.NetConnection;

                    import mx.controls.Alert;

             

                    private const StratusAddress:String = "rtmfp://stratus.adobe.com";

                    private const DeveloperKey:String =

            "4423df5893dcbe33c8e5fe75-e866dfa19977";

                    private var nc : NetConnection;

             

                    private function connect():void

                    {

                        nc = new NetConnection();

                        nc.addEventListener(NetStatusEvent.NET_STATUS,

            netConnectionHandler);

                        nc.connect(StratusAddress + "/" + DeveloperKey);

                    }

             

                    private function netConnectionHandler(event:NetStatusEvent):void

                    {

                        Alert.show(event.info.code,"infocode");

                        Alert.show(nc.nearID,"peerID");

                    }

             

                    ]]>

                </mx:Script>

                <mx:Button x="335" y="238" label="Connect" click="connect()" id="conn"/>

             

             

            </mx:Application>

             

            use this...

            it's ok now.

            • 3. Re: Stratus connection problem?
              suxuekun Level 1

              and

               

              please take care of your develop key........