Re: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-04 Thread Manish Jethani
On 5/2/07, Pan Troglodytes [EMAIL PROTECTED] wrote:

 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.

Try calling validateNow() on the progress bar on the progress event.

This obviously means you're doing the whole measurement/layout every
time a progress event fires, so you probably want to do it on every
Nth iteration.

  progress=counter++;if(counter%10==0)progressBar.validateNow()


Re: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-04 Thread Pan Troglodytes

I tried validateNow() with no success, unfortunately.


On 5/4/07, Manish Jethani [EMAIL PROTECTED] wrote:


  On 5/2/07, Pan Troglodytes [EMAIL PROTECTED]chimpathetic%40gmail.com
wrote:

 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.

Try calling validateNow() on the progress bar on the progress event.

This obviously means you're doing the whole measurement/layout every
time a progress event fires, so you probably want to do it on every
Nth iteration.

progress=counter++;if(counter%10==0)progressBar.validateNow()
 





--
Jason


RE: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-04 Thread Alex Harui
validateNow() does not update the screen.  The screen is only updated
after actionscript finishes executing.  Most folks break things up in
some way using callLater.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Pan Troglodytes
Sent: Friday, May 04, 2007 9:40 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ProgressBar doesn't get updated immediately



I tried validateNow() with no success, unfortunately.



On 5/4/07, Manish Jethani [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote: 

On 5/2/07, Pan Troglodytes [EMAIL PROTECTED]
mailto:chimpathetic%40gmail.com  wrote:

 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.

Try calling validateNow() on the progress bar on the progress
event.

This obviously means you're doing the whole measurement/layout
every
time a progress event fires, so you probably want to do it on
every
Nth iteration.

progress=counter++;if(counter%10==0)progressBar.validateNow()







-- 
Jason 

 


[flexcoders] ProgressBar doesn't get updated immediately

2007-05-02 Thread Pan Troglodytes

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


RE: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-02 Thread Tracy Spratt
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: flexcoders@yahoogroups.com [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 

 



Re: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-02 Thread Pan Troglodytes

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] 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] 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:* flexcoders@yahoogroups.com [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

 





--
Jason


RE: [flexcoders] ProgressBar doesn't get updated immediately

2007-05-02 Thread Tracy Spratt
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Pan Troglodytes
Sent: Wednesday, May 02, 2007 3:04 PM
To: flexcoders@yahoogroups.com
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