FLEX工程调用JAVA类问题?
图片是点击属性看到的flexserver的图片截图,不知道有没有问题,我的工程名称就是TestFlex然后是通过addweb功能整合的,现在可以通过run方式浏览mxml...
图片是 点击属性 看到的 flex server的图片截图,不知道有没有问题,我的工程名称就是TestFlex 然后是通过 add web功能整合的,现在可以通过run 方式浏览 mxml页面,但是增加了remoteobject想调用java类,一点反应没有,<mx:script>里面函数调用java类方法不执行,配置应该不会有误:下面是 <mx:script>函数
public function remotingHelloJavaFlex():void{
var logNam: String = namInputTxt.text;
remoteHello.helloJavaFlex(logNam);
remoteHello.addEventListener(ResultEvent.RESULT, getRoHelloRes);
}
private function getRoHelloRes(e:ResultEvent):void {
Alert.show(e.result.toString());
}
-----------------------remote-config---------------------------------
<destination id="helloJavaFlex">
<properties><source>com.javaflex.HelloJavaFlex</source></properties>
</destination>
--------------------------java-------------------------------
package com.javaflex;
public class HelloJavaFlex {
public String helloJavaFlex(String name){
System.out.println("hello "+name);
return "hello "+name;
}
}
------------------------------mxml--------------------------------
<mx:RemoteObject destination="helloJavaFlex" id="remoteHello"></mx:RemoteObject>
哪有问题呢,郁闷??? 展开
public function remotingHelloJavaFlex():void{
var logNam: String = namInputTxt.text;
remoteHello.helloJavaFlex(logNam);
remoteHello.addEventListener(ResultEvent.RESULT, getRoHelloRes);
}
private function getRoHelloRes(e:ResultEvent):void {
Alert.show(e.result.toString());
}
-----------------------remote-config---------------------------------
<destination id="helloJavaFlex">
<properties><source>com.javaflex.HelloJavaFlex</source></properties>
</destination>
--------------------------java-------------------------------
package com.javaflex;
public class HelloJavaFlex {
public String helloJavaFlex(String name){
System.out.println("hello "+name);
return "hello "+name;
}
}
------------------------------mxml--------------------------------
<mx:RemoteObject destination="helloJavaFlex" id="remoteHello"></mx:RemoteObject>
哪有问题呢,郁闷??? 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询