• Styling the Alert control’s message text


    The following example shows how you can customize the appearance of the message text in an Alert control in Flex by setting the messageStyleName style
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white"
            creationComplete
    ="init();">

        
    <mx:Style>
            @font-face {
                src: local("Comic Sans MS");
                fontFamily: myComicSansMS;
                fontWeight: normal;
            }

            @font-face {
                src: local("Comic Sans MS");
                fontFamily: myComicSansMS;
                fontWeight: bold;
            }

            Alert {
                messageStyleName: myCustomMessageStyleName;
            }

            .myCustomMessageStyleName {
                color: haloOrange;
                fontFamily: myComicSansMS;
                fontSize: 10;
                fontWeight: normal;
            }
        
    </mx:Style>

        
    <mx:Script>
            
    <![CDATA[
                import mx.controls.Alert;

                private var alert:Alert;

                private function init():void {
                    var myMessage:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\nDonec tincidunt sollicitudin sem.";
                    var myTitle:String = "The quick brown fox jumped over the lazy dog";
                    alert = Alert.show(myMessage, myTitle);
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:Button label="Launch alert" click="init();" />
        
    </mx:ApplicationControlBar>

    </mx:Application>

  • 相关阅读:
    使用node.js搭建一个简单的后台服务
    node.js连接MySQL数据库
    js将date对象转换为指定格式
    配置angular2运行环境
    简单AJAX请求JSon数据
    正则表达式
    javascript typeof 和 instanceof 的区别和联系
    map和reduce函数的使用
    Github 上管理项目
    微服务资料
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1034746.html
Copyright © 2020-2023  润新知