1. first you have to create a string of state names as shown below:
public static const UNIT_WEIGHT_METRIC : String = "UNIT_WEIGHT_METRIC";
public static const UNIT_WEIGHT_IMPERIAL : String = "UNIT_WEIGHT_IMPERIAL";
public static const UNIT_HEIGHT_METRIC : String = "UNIT_HEIGHT_METRIC";
public static const UNIT_HEIGHT_IMPERIAL : String = "UNIT_HEIGHT_IMPERIAL";
configState = new StateManager();
configState.addState( UNIT_WEIGHT_METRIC, true );
configState.addState( UNIT_WEIGHT_IMPERIAL, true );
configState.addState( UNIT_HEIGHT_METRIC, true );
configState.addState( UNIT_HEIGHT_IMPERIAL, true );
configState.stateKey = Survey.UNIT_HEIGHT_IMPERIAL;
4.To turn off a state you need to do the same as above as the state manager will check the state and switch it.
5. To check if the state is turned on or off you do the following.
if ( configState.compare( Survey.UNIT_HEIGHT_IMPERIAL))
No comments:
Post a Comment