有时我NetStatusEvent
在使用NetConnection
连接到 Red5 服务器时会遇到问题:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.Failed
这就是我连接的方式(唯一NetConnection.connect()
被调用的地方):
public function Connect(callBack:Function = null):void
{
if (IsConnected())
{
if (callBack != null)
{
callBack.call();
}
}
else // Not connected
{
netConnect.addEventListener(NetStatusEvent.NET_STATUS, function(e:NetStatusEvent):void
{
// OnConnect called whenever there is a net status event
OnConnect(e, callBack);
netConnect.removeEventListener(NetStatusEvent.NET_STATUS, arguments.callee);
});
try
{
// Attempt to connect to Media Server
netConnect.connect(MEDIA_SERVER_URI, true);
}
catch(error:Error)
{
logger.LogError("NetConnection.connect threw an exception.", error);
}
}
}
我正在为NetStatusEvent.NET_STATUS
. 有时我的听众打电话怎么可能?