我刚开始学flex呢,所以如果问题有点小白 请大家不要笑话啊。
写一个java类,名叫FlexTest,里面有一个say()方法,返回一个String。
我还是截几个图说吧。
在remoting-config.xml中加入 <destination id="hello">
<properties>
<source>cn.com.FlexTest</source>
</properties>
</destination>
然后启动服务器。第一次没有报错。
在flex builder 3中创建一个flex项目。
testFlex.mxml主要代码为:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private function resultHandler(event:ResultEvent):void {
Alert.show(event.result.toString(), "连接成功");
}
private function faultHandler(event:FaultEvent):void {
Alert.show(event.fault.toString(), "连接失败");
}
]]>
</mx:Script>
<mx:RemoteObject destination="hello" id="remoteObject"
result="resultHandler(event)"
fault="faultHandler(event)">
</mx:RemoteObject>
<mx:Button label="连接testjava" click="remoteObject.say()" x="256.5" y="197"/>
</mx:Application>
到这里应该就算完成了,但是现在不管是flex builder 3 或者Myeclipse中都报 这个错
这个与flex 中的RemoteObject对应' found in 'destination' from file: remoting-config.xml.
请问这是怎么回事啊?该怎么解决?