States in Flex 4 (entry 3)
Here's a minor iteration to my recent state-controlling button-bar (source code here):
The main difference is that, in this version, whenever the application's state changes, the StateButtonBar's currently-selected state is updated to reflect that change.
Say, for example, that the user presses the StateButtonBar's State3 button, thus setting the application's currentState to "State3". Then, the user presses the stand-alone foo button, beneath the StateButtonBar. This sets the application's currentState to "foo", and because the StateButtonBar now listens for application state changes, it is notified of the state change and can update its own state (by selecting the ButtonBarButton labeled "foo") accordingly.
The main difference is that, in this version, whenever the application's state changes, the StateButtonBar's currently-selected state is updated to reflect that change.
Say, for example, that the user presses the StateButtonBar's State3 button, thus setting the application's currentState to "State3". Then, the user presses the stand-alone foo button, beneath the StateButtonBar. This sets the application's currentState to "foo", and because the StateButtonBar now listens for application state changes, it is notified of the state change and can update its own state (by selecting the ButtonBarButton labeled "foo") accordingly.


0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home