<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
public function calljava(event:Event):void{
remoteObj.getHello("我是flex");
}
public function resultHello(event:ResultEvent):void{
la.text = event.result.toString();
}
]]>
</fx:Script>
<fx:Declarations>
<s:RemoteObject id="remoteObj" destination="test" result="resultHello(event)" />
</fx:Declarations>
<s:Button id="bt" label="调用java" click="calljava(event)"/>
<s:Label text="等待调用数据返回值" id="la"/>
</s:Application>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
public function calljava(event:Event):void{
remoteObj.getHello("我是flex");
}
public function resultHello(event:ResultEvent):void{
la.text = event.result.toString();
}
]]>
</fx:Script>
<fx:Declarations>
<s:RemoteObject id="remoteObj" destination="test" result="resultHello(event)" />
</fx:Declarations>
<s:Button id="bt" label="调用java" click="calljava(event)"/>
<s:Label text="等待调用数据返回值" id="la"/>
</s:Application>