Data Model Flex


  verticalGap="10">
  
    
    import mx.controls.Alert;
    import mx.rpc.http.HTTPService;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;
    private var service:HTTPService
    public function useHttpService(parameters:Object):void {
      service = new HTTPService();
      service.url = "http://server.com/a.jsp";
      service.method = "POST";
      service.addEventListener("result", httpResult);
      service.addEventListener("fault", httpFault);
      service.send(parameters);
    }
    public function httpResult(event:ResultEvent):void {
      var result:Object = event.result;
    }
    public function httpFault(event:FaultEvent):void {
      var faultstring:String = event.fault.faultString;
      Alert.show(faultstring);
    }