To do what you want, you will need to break the long running process up
into smaller chunks, and use callLater between them to allow the UI to
catch up.  If it is a loop, use an instance variable to hold the current
index, process some smaller number of iterations, have the function end,
then callLater to do the next set of iterations, starting at the value
in the instance variable.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Pan Troglodytes
Sent: Wednesday, May 02, 2007 1:55 PM
To: flexcoders
Subject: [flexcoders] ProgressBar doesn't get updated immediately

 

Okay, different problem than my other ProgressBar thread.

This time, I have the progress bar working in event mode, cranking
through sending off progress events.  It works fine, except when it gets
to one section of the code.  I want to send back the progress while this
one very long and time consuming function is happening.  So I have
several points where I dispatch a progress event to the progress bar.  I
have added a "progress" event to the bar to write a line to the trace
log.  It gets these progress events.  However, it doesn't update the
bar.  It seems that the bar redraw is holding off until the other
function finishes.  This is defeating the whole purpose of having the
progress bar. 

Is there some way I can force a bar redraw?  I've tried some of the
invalidate/validate methods with no luck.

-- 
Jason 

 

Reply via email to