1 Reply Latest reply on Sep 15, 2006 4:53 PM by nHeroGo

    Multiple HTTPService calls...

      Multiple HTTPService calls to different XML files...

      I have several XML-files with data. They all have the same structure but different content. I want to call these XML-files and display them in the same layout, having one replacing the previous result. Sounds simple, but I get confused…

      Let’s say I have two buttons making two HTTPService calls,
      <mx:Button … click=”Serv1.send()”>
      <mx:Button … click=”Serv2.send()”>

      <mx:HTTPService id=”Serv1” url=”data1.xml”>
      <mx:HTTPService id=”Serv2” url=”data2.xml”>

      I have a layout of some kind that goes something like this…
      <mx:TileList … dataprovider=”{Serv1.lastResult.collection.object}”/>

      Let’s say that I want to press the second button and call Serv2 and have its results placed in the TileList. I have read about ArrayCollections, and Models, and sending the service-results to a function and import utilities and event-result, but I get a bit confused.

      Can I in a simple way say that, and please misinterpret me correctly here, ... “Serv1.result = Serv2.result;” if you catch my drift?

      PS: As you can imagine, I’ve struggled to get one thing going and expanded on it pretty well, and all I want is to add another button without having to redo all from scratch…
        • 1. Re: Multiple HTTPService calls...
          nHeroGo Level 1
          OK. So it works.

          public function copyHTTP():void {
          Serv1 = Serv2;
          <mx:HTTPService id="Serv1" />
          <mx:HTTPService id="Serv2" ... result="copyHTTP()"/>

          <mx:Button ... click="Serv2.send()"/>
          <mx:TileList dataprovider="{Serv1.lastResult.collection.object}"/>