I have a function that loads a user object from a web service asynchronously.
I wrap this function call in another function and make it synchronous.
For exam
The AS3 port of the PureMVC framework has mechanisms for implementing synchronous operations in a Model-View-Controller context. It doesn't try to synchronize asynchronous calls, but it lets you add a synchronous application pattern for controlling them.
Here's an example implementation: PureMVC AS3 Sequential Demo.
In this example, five subcommands are run sequentially, together composing a whole command. In your example, you would implement getUser()
as a command, which would call commandComplete()
in the getURL()
(or whatever) callback. This means the next command would be certain that the getUser()
operation is finished.