加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读