Styling the Alert control’s nested buttons

简介:
The following example shows how you can customize the appearance of the buttons in an Alert control in Flex by setting the  buttonStyleName  style
<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/  -->
< 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;
        }

        Alert {
            buttonStyleName: myCustomButtonStyleName;
        }

        .myCustomButtonStyleName {
            color: red;
            cornerRadius: 12;
            fontFamily: myComicSansMS;
            fontSize: 10;
            fontWeight: normal;
            textDecoration: underline;
            themeColor: red;
        }
    
</ 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 >





    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/11/1034727.html ,如需转载请自行联系原作者

相关文章
|
4月前
|
CDN
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
39 0
|
5月前
|
安全
Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yo
Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yo
|
7月前
|
Oracle Java 关系型数据库
TYPE_SCROLL_SENSITIVE to TYPE_SCROLL_INSENSITIVE
TYPE_SCROLL_SENSITIVE to TYPE_SCROLL_INSENSITIVE
44 1
|
7月前
|
iOS开发
this code must be changed as there‘s no longer a status bar or status bar window.
this code must be changed as there‘s no longer a status bar or status bar window.
37 0
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
182 0
SAP WM Movement Type 里的‘Ref.Stor.Type Search’字段用法初探
SAP WM Movement Type 里的‘Ref.Stor.Type Search’字段用法初探
SAP WM Movement Type 里的‘Ref.Stor.Type Search’字段用法初探
|
XML Java 数据库连接
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
203 0
Open quote is expected for attribute "{1}" associated with an element type "id".
|
安全 Linux
linux系统下,警告:warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 和 warning: the `gets' function is dangerous and should
字符数组 的英文名字是 char [] gets()函数的基本用法为:char *gets(char *s); 该函数的参数是一个字符数组,该函数的返回值也是一个字符数组。 linux下的代码如下: 1 #include 2 3 int main() 4 { 5    c...
2007 0