3 Replies Latest reply on Feb 12, 2010 1:33 PM by lectersmeal

    Help -- Script timing out during http event listener

    lectersmeal

      So, I have created an HTTPService to retrieve an XML file. The event listener is basically just parsing that XML file and doing another necessary calculation. Unfortunately, the script times out because while small in size, there's a lot of data in it.  I know there's a way to override this with the compiler, but this doesn't seem like a smart thing to do. What are other solutions?

       

      I need the XML data to be loaded when the Flash player loads because it basically displays graph data that people need to be able to see as soon as the page finishes loading.

       

      Thanks so much for you input. I didn't anticipate this timeout problem!

        • 1. Re: Help -- Script timing out during http event listener
          Matt Le Fevre Level 4

          what kind of script is it?

           

           

          and what duration is it timing out after?

           

          Majority of timeouts i've seen occur after 30~60seconds of inactivity! what on earth are you trying to load?!

          • 2. Re: Help -- Script timing out during http event listener
            lectersmeal Level 1

            The default time period is 15 seconds.The XML file that is has to parse through is quite large!

            • 3. Re: Help -- Script timing out during http event listener
              lectersmeal Level 1

              I changed my code to use the URLLoader(), not that it would resolve the problem, but maybe it's the preferred way to do this?

               

              Project Overview (that's relevant):

              The XML data is a bunch of numbers that I need to display on a graph as soon as the page is loaded. So, it must be parsed and obviously remapped to the height of the panel.

               

              The mostly relevant code:

              // openXML() is being called by my controller, which is called by my application's initialize

              public function openXML():void {       
                          var loader:URLLoader = new URLLoader();
                          loader.addEventListener(Event.COMPLETE, loadXML);
                          loader.load(new URLRequest(xmlURL));
                      }

               

              private function loadXML(evt:Event):void {
                          trace("start");
                          var xml:XML = new XML(evt.target.data);
                         
                          // setup all <R> (Reading) tags as an xml list
                          xmlList = xml.R;
                         
                          for (var i:int=0;i<xmlList.length();i++) {
                              value[i]=xmlList.v[i];
                          }   
                         
                          // each value will then need to be remapped to fit the panel
                          // call the gsrController -- which will in turn draw all this stuff       
                  }

               

              So the problem is, I'm new to Flex, and the lack of multithreading seems to be hurting me? I would LOVE for a way for the openXML() file to be able to return the xmlList so that I can take all of that logic OUT of that event listener, which is the way it should be. But how could I do that? I don't think that I can tell openXML() to wait on that event listener before it returns anything - haha.

               

              When I was testing this stuff a few days ago, everything was working perfectly, it was when I used data that corresponded to 40 minutes worth of video that it became a problem!

               

              (And to provide a better overview of what I'm doing, the XML data is for drawing this line that the video player ticker is syncing up with as the video plays......)

               

              http://4228263637768846102-a-1802744773732722657-s-sites.googlegroups.com/site/erinacarroll/projects/videoplayer/gsrplayer2_hanson.jpg?attachauth=ANoY7crJAt2sjDo4y3pBGMyabnb0XFXucBd8TRPFR1N7b4_JuhGx8Q7a5kAEHYov5IhUjiOq33HI0hNqLd-tyAi7ojLYGFp1GLg_bNylQ07dAiY28xcFeOM8B8dJCm2bhfvxlx6Q0t5FkrjtMeo4YFR-VPuArUHuiQnFwbT_XLUrYrVSif2zvqBzgsk1MLf9ZirS_hVCBgnBSDHOQ-wla-7RR-4CWDUCe-UpOnmn9sZdKMeucsV4DxY%3D&attredirects=0