日期:2014-05-17 浏览次数:20838 次
var service:HTTPService = new HTTPService();
service.showBusyCursor = true;
service.method = "POST";
service.addEventListener(FaultEvent.FAULT, faultListener);
service.addEventListener(ResultEvent.RESULT, resultListener);
service.url = "/Project/service/Some.jsp";
var parameters:URLVariables = new URLVariables();
parameters.id = 123;
parameters.name = "abc";
service.send(parameters);
public static function onServiceFault(event:FaultEvent):void {
Alert.show(event.fault.message);
}
public static function onServiceResult(event:ResultEvent):void {
var response:Object = JSON.parse(event.result.toString());
...
}