1 Reply Latest reply on Mar 1, 2008 4:03 PM by peterent

    HTTPService in ActionScript

    pabera
      Hey,

      I am pretty new to Flex and ActionScript, so I used HTTPServices only within MXML. But now I need to use it in ActionScript. I have found some sources via Google, but I could not totally switch my Service from MXML to AS.

      There is the Service I want to "translate"..

      quote:

      <mx:HTTPService
      id="setOfferStatusRPC"
      result="setOfferStatusRPCResult(event)"
      method="POST"
      url="set_offer_status.php"
      useProxy="false"
      showBusyCursor="true">
      <mx:request xmlns="">
      <loggedInUserId>{loggedInUserId}</loggedInUserId>
      <id>{offerDataGrid.selectedItem.id}</id>
      <showid>{offerDataGrid.selectedItem.show}</showid>
      </mx:request>
      </mx:HTTPService>


      So hopefully somebody can help me out here.
      Thx in advance

      pat
        • 1. Re: HTTPService in ActionScript
          peterent Level 2
          Try this:

          var setOfferStatusRPC:HTTPService = new HTTPService();
          setOfferStatusRPC.method = "POST";
          setOfferStatusRPC.url = "set_offer_status,php";
          setOfferStatusRPC.useProxy = false;
          setOfferStatusRPC.showBusyCursor = true;
          setOfferStatusRPC.addEventListener( ResultEvent.RESULT, setOfferStatusRPCResult);

          Then, when you want to make the send requiest:

          setOfferStatusRPC.send( {loggedInUserId:loggedInUserId, id:offerDataGrid.selectedItem.id, showid:offerDataGrid.selectedItem.show} );