1 Reply Latest reply on Jul 13, 2008 2:32 PM by ntsiii

    record count

    realtime158 Level 1
      Lets say you have the following data in a xml file called data.xml

      <record data='1' label='Wal&#45;Mart Stores&#44; Inc&#46; &#40;Walmart&#41;' />
      <record data='5' label='Home Depot&#44; Inc&#46;'/>
      <record data='7' label='Microsoft'/>

      Then you would use a HTTPService

      <mx:HTTPService id='getRecords' url='data.xml' useProxy='false' method='POST'>

      how do you get a record count of the amount of xml data returned.
        • 1. Re: record count
          ntsiii Level 3
          1. set resultFormat="e4x"
          2. Use a result handler: result="onResult(event)"
          3. With an empty post body, flex will send the request as a GET
          4. Watch out for caching, if your xml data ever changes.

          Example result handler:
          private function onResult(event:ResultEvent): void {
          var xmlResult:XML = XML(event.result);
          vat xlRecords:XMLList = xmlResult.record;