I have a Flex 4 app that now and then needs to do a lot of processing, which causes a user to wait a few seconds for it to complete. I know Flex allows one to set and remove busy cursors via the cursor manager. I'm using it as follows:
CursorManager.setBusyCursor(); // add busy cursor
// execute lengthy processing here; e.g. switch to a new screen with a lot of layout
CursorManager.removeBusyCursor(); // remove busy cursor
However, in practice, for certain situations, the busy cursor doesn't display, or, if it displays, it displays just before it gets removed (if you blink you'd miss it). The idea is to have the busy cursor display while the lengthly processing occurs, not for a fraction of a second after it completes.
So, I'm wondering if there's a design pattern I can use to make sure the busy cursor is always displayed BEFORE executing the lengthly processing steps. For example, these processing steps could be: (1) transitioning to a new screen that must be built, which has a complex layout, or (2) creating a chart that takes a long time to render, etc.
I suspect anyone designing in Flex has run into this at one time or another. Is there a general design pattern one can use, or is it a unique adventure each time to figure out where exactly to execute the busy cursor so that it displays at the right moment in time? Any advice appreciated.