1.在src写一个java类,并随便写一个方法
2.在remoting-config.xml中配置这个java类的映射
<destination id="javaclass">
<properties>
<source>javaclass</source>
</properties>
</destination>
3.在mxml中通过RemoteObject对象使用这个远程类
1)配置
<s:RemoteObject
id="javaclass"
destination="javaclass"
showBusyCursor="true"
endpoint="http://localhost:8080/test/messagebroker/amf"
result="javaclass_resultHandler(event)"
fault="javaclass_faultHandler(event)"/>
2)调用
this.javaclass.get("haha");
3)处理结果
this.lab1.text=event.result.toString();