0
main.acs
を呼び出してすべてのユーザーにメッセージをブロードキャストするコードがあります。メッセージをすべてのユーザーにブロードキャストすると、bcStopStreaming関数が呼び出されることはありません。サーバーからのAS3コールバックが機能しない
サーバーサイドコード:
application.onConnect = function(client) {
application.acceptConnection(client);
client.stopStreaming = function() {
trace("#stopStreaming# called");
application.broadcastMsg("bcStopStreaming");
}
client.startStreaming = function() {
trace("#startStreaming# called");
application.broadcastMsg("bcStreaming");
}
}
接続ボタン:
public function btnConnectHandler(event:MouseEvent):void
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.connect("rtmp://"+hostName+"/test");
nc.client = new Object();
nc.client.bcStreaming = function(){
trace("Started Streaming");
};
nc.client.bcStopStreaming = function(){
trace("Stopped Streaming");
};
}
切断]ボタン:私が得る
public function btnDisconnectHandler(event:MouseEvent):void {
nc.call("stopStreaming", null);
nc.close();
}
エラー:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetConnection was unable to invoke callback bcStreaming. error=ReferenceError: Error #1069: Property bcStreaming not found on test and there is no default value.
at test/btnConnectHandler()