一聚教程网:一个值得你收藏的教程网站

热门教程

flash fms3.5 asc文件没反应

时间:2022-07-02 17:00:39 编辑:袖梨 来源:一聚教程网

main.asc:


1. application.onAppStart=function()
2. {
3. trace("fms服务器启动......");
4. };
5.

6.


7. application.onConnect=function(client)
8.  {
9.   this.acceptConnection(client);    
10.   client.sayH=function(str){
11.          return "I can say:Hello "+ str;
12.      };
13.       
14.  };

复制代码

客户端相关代码:

1. private var nc:NetConnection;
2. private var rtmpUrl:String="rtmp://localhost/test";
3. private var rsp:Responder;
4. private var ns:NetStream;
5. private function onConn():void{
6. nc=new NetConnection();
7. nc.connect(rtmpUrl);
8. nc.client=this;
9. rsp=new Responder(onSuc,onFail);
10. nc.call("sayH",rsp,"World");
11. nc.addEventListener(NetStatusEvent.NET_STATUS,conS);
12. nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR,conF);

热门栏目