What is state? what is the difference between states and ViewStack in flex?

Submitted by: Administrator
The State class defines a view state, a particular view of a component. For example, a product thumbnail could have two view states; a base view state with minimal information, and a rich view state with additional information. The overrides property specifies a set of child classes to add or remove from the base view state, and properties, styles, and event handlers to set when the view state is in effect.
You use the State class in the states property of Flex components. You can only specify a states property at the root of an application or a custom control, not on child controls.

Difference between states and ViewStack in flex:
* View Stack is to handle different MXML file eg TAB control and states is the transition within single MXML file.
* ViewStack should be used were there is complete change in the controls used and States should be used when you just want to add or remove a
few components based on certain conditions.
* ViewStates are virtual state of an existing page apearing at an instance i.e. only one state can be shown at a time
while viewStack are collection of different view containers which can be shown at a time
Submitted by: Administrator

Read Online Adobe Flex Actionscript Job Interview Questions And Answers