PureMVC StateMachine lockable door demo

I created and slightly modified Lockable Door application mentioned in StateMachine presentation by Cliff Hall. Application have 3 states OPENED, CLOSED and LOCKED, makes use of entry, exit guards and also sends CHANGED annoucement(notification) for specific(CLOSED) state. This demo is great for beginners learning PureMVC StateMachine Utility.


FSM for Lockable Door

<fsm initial={LockableDoor.STATE_CLOSED}>
    <state name={LockableDoor.STATE_CLOSED}
        exiting={ApplicationFacade.EXITING_CLOSED_STATE}
        changed={ApplicationFacade.CHANGED_CLOSED_STATE}>
        <transition action={LockableDoor.ACTION_OPEN} target={LockableDoor.STATE_OPENED}/>
        <transition action={LockableDoor.ACTION_LOCK} target={LockableDoor.STATE_LOCKED}/>
    </state>
    <state name={LockableDoor.STATE_LOCKED}>
        <transition action={LockableDoor.ACTION_UNLOCK} target={LockableDoor.STATE_CLOSED}/>
    </state>
    <state name={LockableDoor.STATE_OPENED}
        entering={ApplicationFacade.ENTERING_OPENED_STATE}>
        <transition action={LockableDoor.ACTION_CLOSE} target={LockableDoor.STATE_CLOSED}/>
    </state>
</fsm>


FSM Diagram for Lockable Door


Lockable Door demo

width="667" height="280" name="LockableDoor" align="middle"

play="true"

loop="false"

quality="high"

allowScriptAccess="sameDomain"

type="application/x-shockwave-flash"

pluginspage="http://www.adobe.com/go/getflashplayer">

Leave a comment