4,328
社区成员
发帖
与我相关
我的任务
分享
<mx:Application creationComplete="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:HTTPService
url="http://127.0.0.1:8080/ch17/GenerateTreeDataController"
id="getService"
result="treeDataHandler(event)"
fault="errorHandler(event)" />
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.Fault;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
private function init():void{
getService.send();
}
private function treeDataHandler(event:ResultEvent):void{
Alert.show("ok");
}
private function errorHandler(event:FaultEvent):void{
Alert.show("error!");
}
]]>
</mx:Script>
</mx:Application>