3 Replies Latest reply on Jun 29, 2009 10:01 PM by cfchitchat

    Net connection details in flex

    cfchitchat

      Hi,

      How to get netconnect details in flex ?

      I tried with ths but get any results..anyone plz help

       

       

      nc = new NetConnection();
          nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
          nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, netSecurityError);
          nc.connect("rtmp:/myApplication");

        • 1. Re: Net connection details in flex
          aaravind Level 1

          nc=new NetConnection();
                  
                      
              nc.addEventListener(NetStatusEvent.NET_STATUS,conn);

           

          in conn function

           

          public function conn(event:NetStatusEvent):void
                   {
                      Alert.show(""+event.info.code);    //this prints weather u r successfully connected or not
                       switch(event.info.code)

           

          {          
                           case "NetConnection.Connect.Success"://this is done when connection is success..u can give the following code here

          1 person found this helpful
          • 2. Re: Net connection details in flex
            cfchitchat Level 1

            Hi,

            i debuged ths but it didnt reach the

            public function conn(event:NetStatusEvent):void
                     {
                        Alert.show(""+event.info.code);    //this prints weather u r successfully connected or not
                         switch(event.info.code)

             

            {         


                             case "NetConnection.Connect.Success"://this is done when connection is success..u can give the following code here

            • 3. Re: Net connection details in flex
              aaravind Level 1

              When ever netconnection has an event it calls conn function

              ie

              nc.addEventListener(NetStatusEvent.NET_STATUS,conn);

               

              It worked 4 me