Flex中的if...else if...else语句
发布时间:2020-12-15 04:06:39 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"?s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"s:layouts:BasicLayout//s:layoutfx:De
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> </fx:Declarations> <fx:Script> <![CDATA[ import mx.controls.Alert; public function checkPassword():void { if(password.text.length <= 0) { Alert.show("请输入密码!"); } else if(password.text.length < 6) { Alert.show("密码太短,请重新输入!"); } else if(password.text.length > 20) { Alert.show("密码太长,请重新输入!"); } else { Alert.show("输入正确!"); } } ]]> </fx:Script> <mx:VBox width="100%" height="100%"> <s:Group width="100%" height="100%"> <s:layout> <s:VerticalLayout /> </s:layout> <s:TextInput id="password"/> <s:Button label="检查密码" click="checkPassword()"/> </s:Group> </mx:VBox> </s:Application> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ruby-on-rails – ZSH:找不到命令:rails
- 使用CDT for C在Eclipse中重命名类更方便吗?
- 在SQLite中,如何排除包含某些字符串的行?
- C使库适应多线程
- as3加载外部xml,并在其子节点上添加子节点
- ajax与jsonp中的几个封装函数
- Open Flash Chart 一直显示 Loading data,但是不报错,也没
- xcode – “启动屏幕可能没有触发segues. LaunchScreen.sto
- 通过conf/server.xml中的context配置的web项目启动的时候没
- 关于applicationContext.xml cannot be opened because it