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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值