0
votes

i am working through a flash tutorial on webcams but I dont know why the NetConnection is failing.

Here is what i tried.

  • Installed fms , created an empty folder vid2 in applications
  • attempted to record from a webcam but it is failing with the error
Sorry your connection failed
Reason is: undefined

Please help Here is my NetConnection callback

  public function checkConnect (e:NetStatusEvent):void
  {
       switch(e.info.code){
           case "NetConnection.Connect.Success":
           {
             ns = new NetStream(nc);
             trace("checkConnect suceed");  
             break;
           }
           case "NetConnection.Connect.Closed":
           {
              ns.close();
              trace("net connection closed");
              break;
           }
           case "NetConnection.Connect.Failed":
           {
               trace("Sorry your connection failed");
                trace("Reason is: " + e.info.description);
               break;
           }
           case "NetConnection.Connect.Rejected":
           {
               trace("Oops the connection has been rejected");
               break;
           }
       }
  }

entire actionscript file on pastebin

1
How are you sure your server is live and available? - Kodiak

1 Answers

0
votes

You cannot connect to rtmp:/vid2/recordings, instead you need to connect to rtmp://localhost/vid2 (please note that you need to use two forward slashes for the protocol, the address of your server, with the name of an existing folder on the FMS or AMS)

Hope that helps!