Skip to main content
Inspiring
July 1, 2011
Question

NetConnection.Connect.Failed :(

  • July 1, 2011
  • 1 reply
  • 8728 views

Hi i m new for FMS I just wanna make a connection, I put swf file in FMS folder and here my code

package
{
  import flash.net.NetConnection;
  import flash.display.Sprite;
  import flash.text.TextField;
  import flash.events.NetStatusEvent;


  public class main extends Sprite
  {
        private var nc:NetConnection;
        private var rtmpNow:String;
        private var msg:String;
        private var connectText:TextField;

        function main ()
        {
            nc=new NetConnection();
            nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
             rtmpNow="rtmp://216.205.49.71/amit/FMS/";
            //rtmpNow="rtmp:/connection/";
            nc.connect(rtmpNow);
        }
       
        private function checkConnect (event:NetStatusEvent):void
        {
            msg=event.info.code;
            txt.text=msg
        }
  }
}

you can check online it is showing NetConnection.Connect.Failed

http://216.205.49.71/amit/fms/index.html

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    July 1, 2011

    Make sure you have your firewall allowing traffice on ports 1935 and 80. I mean this two ports needs to open for rtmp or rtmpt connections to go through - i suspect your firewall is on and its blocking the rtmp traffic hence NetConnection.Connect.Failed (this message means your connection never reached the server - which can happen because of network issue like firewall or if your FMS is down and not running)

    Inspiring
    July 1, 2011

    I dn't think it is firewall issue because i keep my firewall permanently off, when i trace netstream event function then it shows output NetConnection.Connect.Rejected and instantly NetConnection.Connect.Closed. what does it mean???

    Adobe Employee
    July 1, 2011

    I suspected firewall because you said you got "NetConnection.Connect.Failed". But if you are getting NetConnection.Connect.Rejected - it means connection is reaching FMS and is getting recejected for some reason.

    Your connection URI looked like: rtmpNow="rtmp://216.205.49.71/amit/FMS/" - so do you have application named "amit" in your applications directory?