1.MXML文件
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<s:RemoteObject id="testRemote" destination="testRemote">
<s:method name="getMessage" result="method1_resultHandler(event)"/>
</s:RemoteObject>
</fx:Declarations>
2.xml文件
<destination id="testRemote">
<properties>
<source>java_src.TestRemote</source>
</properties>
</destination>
3.java文件
public class TestRemote {
public String getMessage(){
System.out.println("aaa");
return "Remote Successfule!";
}
}