1 Reply Latest reply on Nov 21, 2007 9:33 AM by levancho

    add event listener to HTTPService call

    ljonny18 Level 1
      Hi – I am using a HTTP service within my flex application.
      My HTTPServeice is connecting to an XML file:

      url=" http://localhost/myResults.xml"
      result="resultHandler(event)" />

      the data within the XML file is constantly changing (the structure remains the same, but the actual data within the structure of the XML changes), therefore I am refreshing my HTTPService results every 5 seconds:

      public var myDataFeed:XML;

      private function initApp():void
      var timedProcess:uint = setInterval(refreshResults, 5000);

      private function refreshResults():void

      private function resultHandler(event:ResultEvent):void
      myDataFeed = event.result as XML;

      My problem is that sometimes the XML file needs longer than 5 seconds to load / refresh the data (as it is quite heavy) etc… therefore I want to implement some sort of event listener on the HTTPService to let the application know when the results have been refreshed so I can restrict / the 5 second refresh taking place until the previos refresh is complete etc…

      is this possible – to set an event listener to a HTTPService to know when it has completed refreshing results from an XML file???