zoukankan      html  css  js  c++  java
  • Using the TitleWindow container to display status messages (转载)

    Another example of something I’ve seen lately on the Internet, so I thought I’d build it in Flex. This time I usea TitleWindow to display the status message of a login form. You can close the message by clicking the X button in the upper-right corner of the title window.

    Note that there is no correct login. It will display the error message every time. In a future example I’ll try and add some fancy fade in/out effects or resize effects on the error message to give it that proper “Web 2.0 feel”

    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white">

        
    <mx:Style>
            TitleWindow {
                cornerRadius: 0;
                backgroundColor: red;
                borderColor: red;
                borderAlpha: 1.0;
            }
        
    </mx:Style>

        
    <mx:Script>
            
    <![CDATA[
                private function showTitleWindow():void {
                    titleWindow.height = 28;
                }

                private function hideTitleWindow():void {
                    titleWindow.height = 0;
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:VBox>
            
    <mx:TitleWindow id="titleWindow"
                    title
    ="Invalid username and/or password."
                    showCloseButton
    ="true"
                    width
    ="100%"
                    height
    ="0"
                    close
    ="hideTitleWindow()" />

            
    <mx:Form>
                
    <mx:FormItem label="Username:">
                    
    <mx:TextInput id="username"
                            maxChars
    ="24" />
                
    </mx:FormItem>
                
    <mx:FormItem label="Password:">
                    
    <mx:TextInput id="password"
                            maxChars
    ="24"
                            displayAsPassword
    ="true" />
                
    </mx:FormItem>
                
    <mx:FormItem>
                    
    <mx:Button label="Login"
                            click
    ="showTitleWindow()" />
                
    </mx:FormItem>
            
    </mx:Form>
        
    </mx:VBox>

    </mx:Application>

  • 相关阅读:
    2013腾讯编程马拉松初赛第〇场(3月20日)湫湫系列故事——植树节 HDOJ 4503
    组合模式(Composite)
    Git Push 避免用户名和密码方法
    [Yii2] 快速套模板,加载JS,CSS(HTML标签<base>)
    phpstorm 2016.2.x 最新版激活方法
    PHP实现四种基本排序算法
    linux下查看负载均衡的两种方法
    Redis各类型应用场景
    HTTP协议2:请求、响应、缓存 2017-03-16 11:20 197人阅读 评论(0) 收藏
    HTTP协议1:工作原理 2017-03-16 11:18 39人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1642786.html
Copyright © 2011-2022 走看看