As I understand it, not knowing Flash, the functions execute in a single
"frame", whatever that is, and the UI does not update until the code
finishes running.  callLater executes the code in the next frame, after
the ui has redrawn.

 

Tracy 

 

________________________________

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

 

Thanks for the reply.  I have used callLater before and I guess that
makes sense.  I'm used to being able to call methods of the gui to force
them to repaint on demand.  I'm guessing Flex must not have the same
kind of functionality. 

And is it just me, or does [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>  need to be booted off this list?
I keep getting bounces from that address everytime I send something to
flexcoders. 

On 5/2/07, Tracy Spratt <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

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] ups.com [mailto:[EMAIL PROTECTED] ups.com
<http://ups.com> ] 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 




-- 
Jason 

 

Reply via email to