mx.states

 

文档上这样写的:

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.

You enable a view state by setting a component's currentState property.

 

可以这样理解:

 

Flex没有页面跳转,但是不能总在一个页面玩啊,通过states 就可以模拟实现。

<mx:states>
 <mx:State name="1">
<!--想要显示什么,想要隐藏什么-->
</mx:State>
 <mx:State name="2">
</mx:State>
 <mx:State name="3">
</mx:State>
</mx:states>

  通过设置

currentState='1' 或者currentState='2' currentState='3'

来达到显示1,2或者3里的内容。类似于通过javascript来设置HTML页面某些控件显示或者某些隐藏来达到显示不同的view功能。

 

例子看:http://livedocs.adobe.com/flex/3/langref/mx/states/State.html#mxmlSyntaxSummary

        http://blog.minidx.com/2008/10/14/1521.html

 

 

你可能感兴趣的:(JavaScript,html,Flex,Blog,Adobe)