fms中介函数


早先整理的一条中介函数。
下边是客户端的函数:
var mync2 = new NetConnection();
btn.onPress = function() {
 ID = txt.text;
 list_arr = [[ID, 123456]];
 mync2.connect("rtmp://localhost/goqo", list_arr);
};
func_arr = [this.func_2(obj.info)];
mync2.onStatus = function(info) {
 trace(info.code);
 if (info.code == "NetConnection.Connect.Success") {
  call_appliaction(this, "func_2", "123", "main");
 }
};
mync2.hello = function(what) {
 output.text = what;
};
function call_appliaction(who, func, info, type, condition) {
 var Send = {};
 Send.func = func;
 Send.info = info;
 Send.type_ = type;
 Send.condition = condition;
 who.call("reCall", null, Send);
}
下边是服务端main.asc文件的代码及解释:
   application.onAppStart = function() {
//menber为客户端成功连接后的用户信息数组在这里初始化;并
//在application.onConnect 事件将用户信息记录
 menber = [];
};
application.onConnect = function(newClient, arr) {
 menber.push(arr[0][0]);
 application.acceptConnection(newClient);
};
Client.prototype.reCall = function(obj) {
  if (obj.type_ == "public" || obj.type_ == true) {
  //广播信息
  application.broadcastMsg(obj.func, obj.info);
 }
//私聊机制
else if (obj.type_ == "private" || obj.type_ == false) {
  for (var i = 0; i
本文转自:http://www.5uflash.com/flashjiaocheng/Fmsjiaocheng/2392.html

你可能感兴趣的:(html,prototype)