<!--[CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import mx.rpc.events.ResultEvent; import cn.Person; [Bindable] public var person:Person; [Bindable]
public var map:ArrayCollection=null;
function sayHello(event:Event):void { var inputVar:String=inputStr.text; test1.hello(inputVar);
}
function sayWorld(event:Event):void { var inputVar:String=inputStr.text; test1.world(inputVar);
}
private function sayHelloResult(event:ResultEvent):void { result.text=event.result.toString(); Alert.show(event.result.toString(), "返回结果"); }
private function sayWorldResult(event:ResultEvent):void { result.text=event.result.toString(); Alert.show(event.result.toString(), "返回结果"); }
private function getMapResult(event:ResultEvent):void { for (var key:String in event.result) { var list:ArrayCollection=event.result[key] as ArrayCollection; for (var key1:Object in list) { Alert.show("map item key is: " + key + " value is: " + key1); }
} }
private function getList():void { test1.getList(); }
private function getListResult(event:ResultEvent):void { var ac:ArrayCollection=event.result as ArrayCollection; for (var i:int=0; i < ac.length; i++) { var p1:Person=ac.getItemAt(i) as Person; Alert.show("list item name is: " + p1.name+" /n another usage : "+ac.getItemAt(i).name); }
} private function getSet():void { test1.getSet(); }
private function getSetResult(event:ResultEvent):void { var ac:ArrayCollection=event.result as ArrayCollection; for (var i:int=0; i < ac.length; i++) { var p1:Person=ac.getItemAt(i) as Person; Alert.show("set item name is: " + p1.name); }