Asynch StateMachine Demo

I’ve whipped up a quick demo for the pureMVC StateMachine utility, illustrating the encapsulation of an asynchronous process (loading external images) within a state.

State Diagram:
[kml_flashembed movie=”” height=”180″ width=”300″ /]
The red LOADING state represents the non-interactive state, were the laoding takes place. The state is left when all the images are loaded (to DISPLAY), or an error occurs (to READY).

Demo App:
[kml_flashembed movie=”” height=”300″ width=”470″ /]

6 thoughts on “Asynch StateMachine Demo

  1. Hi Neil!

    Thank you for this demo! Very informative for a Flex/PureMVC neebe like me!

    Three things needed to get it to work for me:
    1. The Flex Compiler version is set to Use a specific SDK. I had to change it back to Use default SDK.
    2. The image array contains an invalid filename, on purpose I guess, to test error handling (AsynchStateDemo.mxml, line 38, “assets/images/001!.jpg” should be changed to “assets/images/001.jpg”)
    3. When testing in the browser locally, I had to add “-use-network=false” to the Flex Compiler arguments, to avoid the 2148 error

    Regards / Jonas

  2. ahh sorry about this… my blog got hacked a while ago and I haven’t got round to repairing some links.
    I will try and get this back up… am in the middle of a very busy period :(

Leave a Reply

Your email address will not be published. Required fields are marked *