核心提示:FormItem的 visible 和 includeInLayout 属性就绑定到这个 advanced 值上, 前者负责显示和隐藏,后者负责计算位置,可以看一下文档...
|
首先我们建立了一个 private bindable 变量叫做 "advanced" 当点击"Toggle" 按钮时 这个值就会改变。 FormItem的 visible 和 includeInLayout 属性就绑定到这个 advanced 值上, 前者负责显示和隐藏,后者负责计算位置,可以看一下文档 :) 要注意的是Effect是放在FormItem中的。 完整代码在下边:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Script> <![CDATA[ import mx.effects.easing.Bounce; import mx.controls.Alert; [Bindable] private var advanced : Boolean = false; private function onClick() : void { //only toggle if not playing if( !ef_move.isPlaying ) { advanced = !advanced; } } ]]> </mx:Script> <!-- this is the move effect I am using --> <mx:Move id = "ef_move" easingFunction="Bounce.easeOut" /> <mx:Panel title = "Form Example" width = "300" height = "350" > <mx:Form width = "100%" height = "100%" > <mx:FormItem> <mx:Button label = "Toggle Form" click = "onClick()" width = "140" /> </mx:FormItem> <mx:FormItem label = "First Name:" moveEffect = "ef_move" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Last Name:" moveEffect = "ef_move" visible = "{advanced}" includeInLayout = "{advanced}" showEffect = "Fade" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Email:" moveEffect = "ef_move" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Address 1:" visible = "{advanced}" includeInLayout = "{advanced}" showEffect = "Fade" moveEffect = "ef_move" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Address 2:" visible = "{advanced}" includeInLayout = "{advanced}" showEffect = "Fade" moveEffect = "ef_move" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Address 3:" visible = "{advanced}" includeInLayout = "{advanced}" showEffect = "Fade" moveEffect = "ef_move" > <mx:TextInput /> </mx:FormItem> <mx:FormItem label = "Password:" moveEffect = "ef_move" > <mx:TextInput displayAsPassword="true" /> </mx:FormItem> <mx:FormItem moveEffect = "ef_move" > <mx:Button label = "Send Info!" click = "Alert.show('I hope you like my example!');" /> </mx:FormItem> </mx:Form> </mx:Panel> </mx:Application> 加不加弹性效果区别就在于: 如果你想加个easing 效果(Back, Bounce, Elastic, etc),只要指定Move的easingFunction就可以了。
<mx:Script>
<![CDATA[ import mx.effects.easing.Bounce; ]]> </mx:Script> <mx:Move id = "ef_move" easingFunction="Bounce.easeOut" /> |
详细解决方案
Flex 中在表单(Form组件)上填加动画效果(Effect)
热度:84 发布时间:2024-01-16 19:01:53.0
相关解决方案
- Flex xml xmllist 有关问题
- 求jquery.form.js+jquery.validate.min.js 用ajax提交表单的代码范例
- 关于<form action >的一个有关问题
- 新手求解,使用struts报错Cannot retrieve definition for form bean studsForm on action /stu,该怎么解决
- jquery form 有关问题
- form 表单交付 <form action="<c:url value='desktop'/>"
- 项目好好的,忽然就Unknown tag (s:form).不知道为什么
- ENCTYPE="multipart/form-data"文件下传有关问题
- 生手求解,使用struts报错Cannot retrieve definition for form bean studsForm on action /stu
- CAPTCHA 模块中 ajax form 导致CAPTCHA session reuse attack detected异常,解决方法
- Flex 函数写法解析,该如何处理
- enctype="multipart/form-data"的页面中,获取普通表单中文值,
- 在jsp页面下导入.xls文件,报错:Posted content type isn't multipart/form-data
- jsp form 表单 提交 带特殊符号 求高手帮忙解答上多谢!
- flex-java 怎么让两个同时执行的事件有执行顺序
- form.getForm.submit对象不支持此属性或步骤
- jsp中<form>标记有关问题?头疼了很多天
- action无法获取<s:form>的输入解决方法
- form action 和 javascript 的提交問題解决方法
- s:form 的anction 标签[]
- 关于enctype="multipart/form-data"及过滤器的怪异有关问题~
- import form.addBookForm 有晓得这个包的出处的嘛?SOS~
- Windows Form 中怎么将 treeview 的节点与页面内容关联
- 怎样把Html文本转换为System.Windows.Form.HtmlDocment对象!解决方法
- Form.FormClosing事件不触发(winform)解决思路
- 将html form 内容写到后盾
- .net MVC下运用FckEditor检测到有潜在危险的 Request.Form
- 从客户端(FCKeditor1="哇啦哇")中检测到有潜在危险的 Request.Form 值
- freetextbox 检测到有潜在风险的 Request.Form 值
- 从客户端(Content="<p>测试</p>")中检测到有潜在风险的 Request.Form 值