The tag is used with properties to provide code hints for that property and to specify the possible list of values that property can take while using it in mxml. Unlike [Bindable]
metadata, this tag doesn't have much effect on the working of the code (other than specifying a default value) - this is used mainly to give directions to Flex Builder regarding how to deal with a particular property.
[Inspectable]
metadata tag
Defines an attribute exposed to component users in the attribute hints and Tag inspector of Flex Builder. Also limits allowable values of the property.
For example, the verticalScrollPolicy
property of the mx.core.Container
class has the following [Inspectable]
tag with it.
[Inspectable(category="General", enumeration="off,on,auto", defaultValue="auto")]
public function get verticalScrollPolicy():String
{
return _verticalScrollPolicy;
}
This tells Flex Builder that this property should appear in the 'General' tab (it is 'Common' in my FB) of the Flex Builder's property inspector (open an mxml file, go to the Windows
menu and select Flex Properties
to open the property inspector - towards the upper side of inspector tab, near its title, you will find buttons to switch to standard view, category view, and alphabetical view). This property can take one of the three values off
, on
, auto
and if none is specified it takes auto
as its default value.
I've never used this tag and I believe you too won't be using it much unless you are writing a Flex API to be used by a bigger audience than your colleagues (or if you are a perfectionist).
Best Answer
The ViewStack and States actually aren't really related. Can you rephrase to make your question more specific?
The ViewStack is a component that is used to display different views (normally of different data, but not necessarily), one at a time.
States are related views of a single set of data. For example, you may want to have a 'normal' view and an 'advanced' view of, say, a user's profile - where the advanced view displays more options, or a larger picture, etc.
States work with Transitions, which are coordinated animations that elegantly switch between states.
That's a real brief explanation. Hope it's useful.