Error #2126: NetConnection object must be connected

Posted by Shuo on Stack Overflow See other posts from Stack Overflow or by Shuo
Published on 2010-03-07T13:44:38Z Indexed on 2010/03/08 22:06 UTC
Read the original article Hit count: 220

Filed under:
|

Hey guys ,

I want to count the online user,when each client login the system,it's connecting to the server and increase a variable stored in a remote shared object.

But when client connecting server,problems arises:Error #2126: NetConnection object must be connected

My web layout:

Website --- apps --- userLogin

Code snippets:

rtmpnc = new NetConnection();
 rtmpnc.objectEncoding = ObjectEncoding.AMF0;
 var uri:String = ServerConfig.getChannel("my-rtmp").endpoint + "/userLogin";
 rtmpnc.connect("http://202.206.249.193:2367/userLogin");
                rtmpnc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatusHandler);

The onNetStatusHander is defined as :

switch(event.info.code)
   {
       case "NetConnection.Connect.Success":onConnSuccess();break;
       case "NetConnection.Connect.Failed":onConnError();break;
   }

Could anyoue help me out?Much thanks!

Best,Shuo

© Stack Overflow or respective owner

Related posts about flex

Related posts about ASP.NET