You do not need to do a lock, but you can track the order of changes in your state. The various asynchronous calls that are in the game can return and change the state of the model in an order different from when the asynchronous calls were issued.
Flex and AIR applications have a single-threaded programming model. However, their architecture is based on asynchronous I / O to interact with the server layer.
Now in a Java Swing or .NET Winforms application, you can interact with i / o on the return line flow and marshal the arguments / results to and from the main GUI stream. (These graphical user interface libraries do not allow other threads to change the state of objects / widgets of graphical tools, and, therefore, data interaction should be tied to other phonogram processing threads.)
In contrast, the i / o class library from Flex and AIR is written where these classes perform I / O asynchronously. For example, to perform an HTTP GET, the HttpSerivce send () method may be called, which is not a blocking call. Instead, an ActionScript3 closure may be provided to handle the result whenever the call completes and returns.
In the meantime, the Flex / AIR application may allow the graphical interface to continue to be fully interactive for the user. It can even display a progress indicator and / or a Cancel button.
Thus, it turns out that although the single-threaded Flex / AIR GUI model is simpler and simpler to program than multi-threaded Java Swing or .NET Winform applications, it is capable of the same complex user interface behavior as those rich client application styles.
A simple event-driven, single-threaded graphical interface, asynchronous I / O (through service calls and / or messaging), combined with closing ActionScript3 to handle results or failures, is Flex / AIR's secret recipe for world domination. (Of course, I should mention good support for properties, events, and good declarative or imperative data bindings, too, as part of this strategy for conquering the world.)