flex登錄界面實例1

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[0x000000,0x323232]" fontSize="12">
    <mx:Script>
        <![CDATA[
            // Import easing classes if you use them only in MXML.
            import mx.effects.easing.Bounce;
        ]]>
    </mx:Script>

    <!-- Define the transition to animate the change of view state. -->
    <mx:transitions>
       <mx:Transition>
            <mx:Parallel 
              targets="{[loginPanel, registerLink, loginButton, confirm,realname,tel,email,areaname,realnameL,telL,emailL,areanameL]}">
                <mx:Resize duration="500" easingFunction="Bounce.easeOut"/>
                <mx:Sequence targets="{[confirm,realname,tel,email,areaname,realnameL,telL,emailL,areanameL]}">
                   <mx:Blur duration="200" blurYFrom="1.0" blurYTo="20.0"/>
                   <mx:Blur duration="200" blurYFrom="20.0" blurYTo="1"/>
                </mx:Sequence>
            </mx:Parallel>
        </mx:Transition>
    </mx:transitions>
        
    <mx:states>
        <mx:State name="Register">
            <mx:AddChild relativeTo="{loginForm}" 
                position="lastChild">
                <mx:FormItem id="confirm" label="確   認:">
                    <mx:TextInput/>
                </mx:FormItem>
            </mx:AddChild> 
            <mx:AddChild relativeTo="{loginForm}" 
                position="lastChild">
            <mx:FormItem id="realnameL" label="真實姓名:">
                <mx:TextInput id="realname"/>
            </mx:FormItem>
            </mx:AddChild> 
            <mx:AddChild relativeTo="{loginForm}" 
                position="lastChild">
            <mx:FormItem id="telL" label="電話:">
                <mx:TextInput id="tel"/>
            </mx:FormItem>
            </mx:AddChild>
            <mx:AddChild relativeTo="{loginForm}" 
                position="lastChild">
            <mx:FormItem id="emailL" label="Email:">
                <mx:TextInput id="email"/>
            </mx:FormItem>
            </mx:AddChild>
            <mx:AddChild relativeTo="{loginForm}" 
                position="lastChild">
            <mx:FormItem id="areanameL" label="所在區域:">
                <mx:TextInput id="areaname"/>
            </mx:FormItem>
            </mx:AddChild>                                                              
            <mx:SetProperty target="{loginPanel}"
                name="title" value="用戶註冊"/>            
            <mx:SetProperty target="{loginButton}"
               name="label" value="註冊"/>
            <mx:RemoveChild target="{registerLink}"/>
            <mx:AddChild relativeTo="{spacer1}" position="before">
                <mx:LinkButton label="返回登錄" 
                    click="currentState=''"/>
            </mx:AddChild>
        </mx:State>
    </mx:states>

    <mx:Panel id="loginPanel" 
        title="用戶登錄" color="0xffffff" borderAlpha="0.15"
        horizontalScrollPolicy="off" verticalScrollPolicy="off" horizontalCenter="0" verticalCenter="022">

        <mx:Form id="loginForm" color="0x323232">
        <mx:FormItem label="用戶名:">
            <mx:TextInput/>
        </mx:FormItem>
        <mx:FormItem label="密   碼:">
            <mx:TextInput/>
        </mx:FormItem>
    </mx:Form>
    
    <mx:ControlBar>
        <mx:LinkButton id="registerLink"
            label="新用戶註冊" 
            click="currentState='Register'"/>
        <mx:Spacer width="100%" id="spacer1"/>
        <mx:Button label="登錄" id="loginButton"/>
    </mx:ControlBar>
    </mx:Panel>

</mx:Application>





發佈了15 篇原創文章 · 獲贊 20 · 訪問量 27萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章