我正在学习网络摄像头的 Flash 教程,但我不知道为什么 NetConnection 会失败。
这是我尝试过的。
- 安装 fms ,在应用程序中创建了一个空文件夹 vid2
- 尝试从网络摄像头录制,但失败并出现错误
Sorry your connection failed
Reason is: undefined
请帮助这是我的 NetConnection 回调
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;
}
}
}