Forcing Flex to update the screen?

Posted by ABBarton on Stack Overflow See other posts from Stack Overflow or by ABBarton
Published on 2009-07-13T17:09:43Z Indexed on 2010/05/10 21:14 UTC
Read the original article Hit count: 241

Filed under:
|

This may be a bit of a beginners question, but I can't for the life of me figure it out.

I'm using flex to develop a GUI for a large project, specifically a status bar along the bottom. Within my StatusBar class is a ProgressBar, which other classes doing work can tell to update(change bar completion and label) as they progress. The problem I'm encountering is that flex won't update whats shown on the screen until it's too late, for example

ProgressBar initialized, 0% done
some class sets the ProgressBar to be 12% done
some class does some work
some class sets the ProgressBar to be 56% done

Whats happening is the 12% done is never displaying, it just hangs at 0% during the work, then skips right to 56% done. I've tried to understand the lifecycle of a flex component (invalidation and validation), and I think I understand it and am applying it correctly, but it's not working at all. I need to tell flex to redraw my StatusBar (or at least the ProgressBar within) after some class sets it to be 12% done, but before some class starts doing its work. How do I do this?

© Stack Overflow or respective owner

Related posts about flex

Related posts about redraw