Title: Message
The Flash player won't update the screen while one of your methods is executing. You'll have to break your work up into chunks which can execute over a sequence of frames. A typical way to do this is:
 
1. Define an object which will keep track of how far your work has progressed. For example, it might store that you have processed 50 tree nodes.
 
2. Write a method which will incrementally do more work. For example, it might 10 more tree nodes starting from where you left off the last time it was invoked.
 
3. Have this method doLater() itself if it doesn't finish the job.
 
I'm sorry thatI don't have any code to share that illustrates this technique, but I hope you get the idea.
 
- Gordon
 
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 5:06 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Force UI update during intense AS work: doLater, maybe?

One part of our app does VERY intense work, building a tree, an inverted tree (thousands of nodes), and several arrays.  Even though I have a progress bar, and update it and its label throughout the various function calls, those updates never appear on the screen, until that particular processing ends and we go to get more data.

I have fiddled with using doLater between the recursive function calls, but did not have any success forcing the screen to repaint.

Is doLater the right idea?  Do I put my screen update code before the doLater? After? How can I tell the processing to take a breath and let the UI render?

Tracy



Yahoo! Groups Links

Reply via email to