FMS (rtmfp)를 사용하여 Netgroup에 연결합니다. Netgroup (reiceve NetStatusEvent "NetGroup.Connect.Success")에 연결할 수 있지만 그게 전부입니다. 아무 것도 게시 할 수 없거나 다른 사람이 Netgroup에 가입했는지 확인할 수 없습니다. NetStatusEvent는 실행되지 않습니다. 내가 놓친 게 있니? 여기 Netgroup 이벤트를 수신 할 수 없습니다.
코드입니다 : 당신은 스위치 블록에 "NetGroup.Posting.Notify"를 확인하고, 넷 클래스의 포스트 방법을 사용할 필요가public function connect(url:String):void {
_nc = new NetConnection();
_nc.client = this;
_nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_nc.connect(url);
}
private function netStatusHandler(event:NetStatusEvent):void {
switch (event.info.code){
case "NetConnection.Connect.Success":
createGroup();
break;
case "NetGroup.Connect.Success":
//post msg to the group
var message:Object = new Object;
message.text = "Hello";
message.sender = _nc.nearID;
_netGroup.post(message);
break;
default:
trace("event.info.code: " + event.info.code);
break;
}
}
private function createGroup():void {
_groupSpecifier = new GroupSpecifier("test_group");
_groupSpecifier.postingEnabled = true;
_groupSpecifier.multicastEnabled = true;
_groupSpecifier.serverChannelEnabled = true;
_netGroup = new NetGroup(_nc, _groupSpecifier.groupspecWithAuthorizations());
_netGroup.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
}
. 유일한 이벤트는 NetGroup.Connect.Success입니다. netgroup에 메시지를 게시 할 때 어떤 이벤트도 수신되지 않습니다. –
스위치 블록에서 수신 대기합니까? (내 방식을 대답에 추가) –
음 ... 죄송합니다, 신중하게 코드를 확인하지 않았다. 귀하의 게시물 방법이 있습니다.죄송합니다. 왜 그걸 추적하지 않는지 알지 못합니다. ( –