9 Replies Latest reply on Nov 15, 2009 10:59 AM by timo888

    any equivalent for MSFT Application.DoEvents ? :  progress bar not updating in real time, but all at once

    timo888

      THE PROBLEM

      The ProgressBar (explicitly set to "manual" mode) is doing nothing until my data-Fetcher object is completely done iterating an array and executing a prepared SQL statement with each iteration.  With each iteration, the Fetcher raises an event and the handler listening for the event is indeed hearing the event with each iteration, but the GUI is not responding in real time. Instead, the progress bar shoots to 100% all at once.

       

      The tight loop in the Fetcher object may be sucking up all the CPU, and not giving the GUI a chance to reflect the progress (adl.exe CPU jumps to 89% in Task Manager).  When this happens in Microsoft .NET, the developer can call an Application.DoEvents method which is meant to give the GUI a chance to do its stuff under such circumstances. Any counterpart in Flex/AIR?

       

      private function onNextTitle(e:NextTitle): void {

      // this eventhandler is executing properly but the GUI isn't changing incrementally
                  this.myProgressBar.setProgress(myProgressBar.value +1, HitsGrid.selectedIndices.length);
          }