AS3.0连接FMS2.0测试

      FMS 2007-1-25 0:56:00

var fmsIP:String = "127.0.0.1";
var fmsPath:String = "rtmp://"+fmsIP+"/audioOnLine_fms/";
var myNC:NetConnection = new NetConnection();
myNC.objectEncoding = ObjectEncoding.AMF0;
myNC.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
myNC.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
function netStatusHandler(event:NetStatusEvent):void {
 switch (event.info.code) {
  case "NetConnection.Connect.Success":
  trace("连接成功!")
  getStream();
  break;
  case "NetStream.Play.StreamNotFound":
  trace("未找到视频文件: " + videoURL);
  break;
  }
  }
function securityErrorHandler(event:SecurityErrorEvent):void {
 trace("安全沙箱错误侦听: " + event);
 }
function getStream():void {
 var myNS:NetStream = new NetStream(myNC);
 myNS.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
 movie.Live_video.attachNetStream(myNS);
 myNS.play("1");
 }
myNC.connect(fmsPath)

标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}
深度XP 雨林木风XP WinXP下载 世界之窗 深度系统 雨林木风 Ghost ghost系统盘 XP下载