fla:
//server呼叫client端
//要把函数定义到nc上!!
//
mync = new NetConnection();
mync.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace("连接成功");
}
};
mync.connect("rtmp://localhost/connect");
mync.msgfromserver = function(msg) {
trace(msg);
};
//要把函数定义到nc上!!
//
mync = new NetConnection();
mync.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace("连接成功");
}
};
mync.connect("rtmp://localhost/connect");
mync.msgfromserver = function(msg) {
trace(msg);
};
main.asc:
application.onConnect = function(client) {
application.acceptConnection(client);
//这里呼叫刚连线成功的客户
//跟client呼叫server基本一样,服务器一般很少让client端返回值所以第2个参数设为null
client.call("msgfromserver",null,"服务器叫你啊")
};
application.acceptConnection(client);
//这里呼叫刚连线成功的客户
//跟client呼叫server基本一样,服务器一般很少让client端返回值所以第2个参数设为null
client.call("msgfromserver",null,"服务器叫你啊")
};