Flex中用state来表示不同的状态的经典的例子
2012-03-20 21:06
357 查看
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:states> <mx:State name="Register"> <mx:AddChild relativeTo="{loginForm}" position="lastChild"> <mx:target> <mx:FormItem id="confirm" label="Confirm:"> <mx:TextInput/> </mx:FormItem> </mx:target> </mx:AddChild> <mx:SetProperty target="{loginPanel}" name="title" value="Register"/> <mx:SetProperty target="{loginButton}" name="label" value="Register"/> <mx:SetStyle target="{loginButton}" name="color" value="blue"/> <mx:RemoveChild target="{registerLink}"/> <mx:AddChild relativeTo="{spacer1}" position="before"> <mx:target> <mx:LinkButton id="loginLink" label="Return to Login" click="currentState=''"/> </mx:target> </mx:AddChild> </mx:State> </mx:states> <!-- Define a Panel container that defines the login form.--> <mx:Panel title="Login" id="loginPanel" horizontalScrollPolicy="off" verticalScrollPolicy="off" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> <mx:Text width="100%" color="blue" text="Click the 'Need to Register?' link to change state. Click the 'Return to Login' link to return to the base state."/> <mx:Form id="loginForm" > <mx:FormItem label="Username:"> <mx:TextInput/> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true"/> </mx:FormItem> </mx:Form> <mx:ControlBar> <mx:LinkButton id="registerLink" label="Need to Register?" click="currentState='Register'"/> <mx:Spacer width="100%" id="spacer1"/> <mx:Button label="Login" id="loginButton"/> </mx:ControlBar> </mx:Panel> </mx:Application>
相关文章推荐
- Flex中如何利用mx:states和mx:State创建不同状态应用的例子
- Flex中如何利用mx:states和mx:State创建不同状态应用的例子
- Flex中如何通过设置editable属性控制NumericStepper控件可编辑/不可编辑状态的例子
- Flex 状态(state)和过渡(transition)
- Flex中如何通过mode属性设置进度条ProgressBar动画状态的例子
- Tour de Flex中经典例子(一)-------LinkBar与Viewstack实现导航
- kernel中表示系统状态的全局变量system_state
- Flex 4在多状态(State)下使用事件(如click等)要特别注意
- flex4 state状态的使用
- 积少成多Flash(10) - Flex 3.0 状态转换(State), 状态转换的过渡效果(State Transition), 自定义鼠标指针
- 利用ToolTipManager类检测并取得Flex应用中当前ToolTip状态/内容的例子
- flex4里的的状态(State)——1
- Flex中关于DateField控件的selectableRange属性的几种不同用法的例子
- Tour de Flex经典例子(二)----DataGroup(包含ItemRenderer重构及特效)
- Android中View(视图)绘制不同状态背景图片原理深入分析以及StateListDrawable使用详解
- 积少成多Flash(10) - Flex 3.0 状态转换(State), 状态转换的过渡效果(State Transition), 自定义鼠标指针
- State 引入一组表示对象状态的类,然后,把与状态相关的代码逻辑分配到这些类中
- Android中View(视图)绘制不同状态背景图片原理深入分析以及StateListDrawable使用详解
- Flex中如何让TextInput被选中文本保持选中状态而不管控件是否获得焦点的例子
- 状态模式(state)解析例子 推荐