red5 HelloWorld

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="TT()">
	<mx:Script>
		<![CDATA[
	     private var nc:NetConnection;  
           
         public function TT():void
         {  
             nc=new NetConnection();  
             nc.objectEncoding=ObjectEncoding.AMF0;  
 //          nc.objectEncoding = ObjectEncoding.AMF0;  
             nc.addEventListener(NetStatusEvent.NET_STATUS,start);  
             nc.connect("rtmp://localhost:1935/HelloWorld");
             var response:Responder=new Responder(reslt,error);  
      
             nc.call("say",response,"你好");  
               
         }  
         public function start(evt:NetStatusEvent):void{  

                      trace( "连接信息……..\n"+evt.info.code);  
             if (evt.info.code == "NetConnection.Connect.Rejected" ){  
             trace( evt.info.application );  
             }  
         }  
           
        private function reslt(rs:Object):void{  
             trace("服务端返回结果为:….."+rs);  
         }  
         private function error(err:Object):void{  
             trace("连接错误:….."+err);  
         }  
		]]>
	</mx:Script>
</mx:Application>
package com;

import org.red5.server.adapter.ApplicationAdapter;

public class Hello extends ApplicationAdapter {

		public String say(String hello){
			return hello;
		}
}
 我下的是red6.0 web-inf下必须吧 hello.class 打包到lib下 

 

webapp.contextPath=/HelloWorld
webapp.virtualHosts=*, localhost, localhost:8088, 127.0.0.1:8088
 
<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>/HelloWorld</param-value>
	</context-param>
 

你可能感兴趣的:(xml,Web,.net,Adobe)