December 20th, 2005
Why I hate doLater and waiting a frame
Posted by
Ash in
General
The whole method of waiting a frame to allow other functions to complete never sat right with me. It just seems.. broken.
In the MX components, doLater is used a lot - a function for putting off execution of another function until the next frame.. usually to allow other child components to finish initializing before laying them out.
Personally I would have used a cascading series of events, where the child components dispatch an “Ok I’m ready” event. The parent component would listen for these and when all child components are ready, it does its stuff and dispatches its own “Ready” event.
I’d be interested to know what methods other people use to make sure that things like layout get executed in the right order.
