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

Flex学习笔记(五) 动画效果

发布时间:2020-12-15 01:00:27 所属栏目:百科 来源:网络整理
导读:?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" minWidth="955" minHeight="600" currentState="Login"s:statess:S
<?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" minWidth="955" minHeight="600"
			   currentState="Login">
	<s:states>
		<s:State name="Login"/>
		<s:State name="Portal"/>
	</s:states>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
		
		<s:Sequence id="shake"
					target="{loginPanel}"
					duration="100">
			<s:Move xBy="20"/>
			<s:Move xBy="-20"/>
			<s:Move xBy="20"/>
			<s:Move xBy="-20"/>
			<s:Move xBy="20"/>
			<s:Move xBy="-20"/>
		</s:Sequence>
		
		<s:Move xBy="20"/>
		
	</fx:Declarations>
	
	
	<fx:Script>
		<![CDATA[
			
			
			private function checkLogin():void
			{
				if(username.text == "flex" && password.text == "123")
				{
					currentState = "Portal";
				}
				else
				{
					shake.play();
				}
			}
			
		]]>
	</fx:Script>

	
	<s:Panel id="loginPanel" 
			 includeIn="Login" 
			 x="83" y="112" width="354" height="261" 
			 title="Login">
		
		<s:Label x="116" y="47" text="UserName"/>
		<s:TextInput id="username" x="116" y="67"/>
		
		<s:Label x="116" y="101" text="Password"/>
		<s:TextInput id="password" x="116" y="121" displayAsPassword="true"/>
		
		<s:Button id="button" x="141" y="180" label="Submit" click="checkLogin()"/>
		
	</s:Panel>
	
	<s:Panel includeIn="Portal" 
			 x="250" y="109" 
			 width="250" height="200" 
			 title="Portal">
	</s:Panel>
	
	
</s:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读