Question : FMS3 Beginner question - connection testing sample

i'm reading a book with sample connection code as followings:

when i run the swf, the following error message produces:
ArgumentError: Error #2004: One of the parameters is invalid.
      at flash.net::NetConnection/connect()
      at FMS3Connect$iinit()
What's the problems? thanks
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
package
{
  import flash.net.NetConnection;
        import flash.display.Sprite;
  import flash.text.TextField;
  import flash.events.NetStatusEvent;
 
  public class FMS3Connect extends Sprite
  {
        private var nc:NetConnection;
        private var rtmpNow:String;
        private var msg:String;
        private var connectText:TextField;
        private var posX:Number;
 
        function FMS3Connect ()
        {
 
             nc=new NetConnection();
             nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
             rtmpNow="rtmpe://192.168.0.106/connect";
             //rtmpNow="rtmpe:/connect";
             nc.connect (rtmpNow);
        }
        private function checkConnect (event:NetStatusEvent):void
        {
             connectText=new TextField();
             msg=event.info.code;
             connectText.width=250;
             connectText.text=msg;
             addChild (connectText);
             posX=connectText.stage.stageWidth;
             connectText.x=(posX/2)-((msg.length/2)*(6));
             connectText.y=175;
        }
  }
}
Open in New Window Select All

Answer : FMS3 Beginner question - connection testing sample

Great, keep me posted :)
Random Solutions  
 
programming4us programming4us