Styling the Alert control’s status message

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

        .myCustomStatusStyleName {
            color: red;
            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);
                alert.status = "status message";
            }
        
]]>
    
</ 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/1034718.html ,如需转载请自行联系原作者


相关文章
|
4月前
引用 AspNetCoreRateLimit => StatusCode cannot be set because the response has already started.
引用 AspNetCoreRateLimit => StatusCode cannot be set because the response has already started.
66 0
|
7月前
|
SQL
WARNING: too many parse errors' in the 12.2 Alert.log
WARNING: too many parse errors' in the 12.2 Alert.log
71 2
|
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
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
124 0
|
Linux
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
111 0
unknown type name err_status_t; did you mean srtp_err_status_t/err_status_ok/err_status_replay_fail
unknown type name err_status_t; did you mean srtp_err_status_t/err_status_ok/err_status_replay_fail
163 0
Whitelabel Error Page There was an unexpected error (type=Not Found, status=404). No message availab
Whitelabel Error Page There was an unexpected error (type=Not Found, status=404). No message availab
184 0