Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>How long does it take to request, receive and process the XML? It sounds like it's a fairly big file, so if it's more than a second, you'll have multiple calls to the HTTPService happening concurrently (as I understand it, your current timer will try and fire off a request every second, regardless of whether the last one has returned).</p> <p>I'm not sure if this is what you want, but I doubt it. If I'm right, and you only want to send a request after you've got the response from the last one, then you would probably be better off getting rid of the timer and its function, then changing the resultHTTP method to something like this:</p> <pre><code>private function resultHTTP(event:ResultEvent):void { xmlData = event.result as XML; xmlC.source = xmlData.dg.rows.row; httpS.send(); } </code></pre> <p>Of course, you may want to put a delay on it starting each time:</p> <pre> protected function application1_creationCompleteHandler(event:FlexEvent):void { httpS.url = "data.xml"; httpS.addEventListener(ResultEvent.RESULT, resultHTTP); httpS.resultFormat="e4x"; timer.start(); timer.addEventListener(TimerEvent.TIMER, updateXMLC); } private function updateXMLC(event:TimerEvent):void { timer.stop(); httpS.send(); } private function resultHTTP(event:ResultEvent):void { xmlData = event.result as XML; xmlC.source = xmlData.dg.rows.row; timer.start(); } </pre> <p>Sorry if I've misunderstood the issue though...<br/></p> <p>Either way, you probably want to put some sort of faultHTTP function in as well, so it also restarts the timer (or does whatever you need to do) on HTTP errors.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload