1、运行Flash Media Server4.5.exe,安装选项可全默认,序列号可不填;输入用户名和密码需记住,登录时要用。
2、安装完成,在安装目录C:\Program Files\Adobe\Flash Media Server 4.5\tools\下找到fms_adminConsole.htm或者fms_adminConsole.swf,这是管理文件,打开其中之一填入相应信息登录,Server Address 填本机ip,如192.168.3.106,Username和Password填安装时输入的用户名和密码。或者在开始菜单中找到Adobe/Flash Media Server 4.5/Adobe Flash Media Administration Console亦可。
3、登录成功,这里可以简单的管理FMS服务器和链接到此服务器的客户端信息。
代码测试:
1 var nc:NetConnection = new NetConnection(); 2 nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 3 nc.connect("rtmp://localhost/HelloServer"); 4 function netStatusHandler(event:NetStatusEvent):void { 5 trace("connected is: " + nc.connected); 6 trace("event.info.level: " + event.info.level); 7 trace("event.info.code: " + event.info.code); 8 9 switch (event.info.code) 10 { 11 case "NetConnection.Connect.Success": 12 trace("Congratulations! you‘re connected" + "\n"); 13 break; 14 case "NetConnection.Connect.Rejected": 15 trace ("Oops! the connection was rejected" + "\n"); 16 break; 17 case "NetConnection.Connect.Closed": 18 trace("Thanks! the connection has been closed" + "\n"); 19 break; 20 } 21 }
注意:需要在C:\Program Files\Adobe\Flash Media Server 4.5\applications目录下新建目录HelloServer。
时间: 2024-10-10 14:14:38