Skip to content

Instantly share code, notes, and snippets.

@neilmanuell
Created June 11, 2012 11:06
Show Gist options
  • Save neilmanuell/2909606 to your computer and use it in GitHub Desktop.
Save neilmanuell/2909606 to your computer and use it in GitHub Desktop.
FSM Declaration with Strings vs enmubs
// state names
public static const LOADING:StateName = new StateName("loading");
public static const DECODING:StateName = new StateName("decoding");
public static const DISPLAYING:StateName = new StateName ("displaying");
// process names
public static const IN:ProcessName = new ProcessName("in");
// state declaration
fsmConfig.configureState( LOADING )
.withTransitionTargets( DECODING );
fsmConfig.configureState( DECODING )
.withTransitionTargets( DISPLAYING );
fsmConfig.configureState( DISPLAYING )
.withTransitionTargets( LOADING );
// process declaration
fsmConfig.configureProcess( IN )
.ifCurrentState( DISPLAYING )
.transitionTo( LOADING, DECODING, DISPLAYING );
// state names
public static const LOADING:String = "state/loading";
public static const DECODING:String = "state/decoding";
public static const = "state/displaying";
// process names
public static const IN= "process/in";
// state declaration
fsmConfig.configureState( LOADING )
.withTransitionTargets( DECODING );
fsmConfig.configureState( DECODING )
.withTransitionTargets( DISPLAYING );
fsmConfig.configureState( DISPLAYING )
.withTransitionTargets( LOADING );
// process declaration
fsmConfig.configureProcess( IN )
.ifCurrentState( DISPLAYING )
.transitionTo( LOADING, DECODING, DISPLAYING );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment