The following example shows how you can customize the appearance of the status message in an alert control in Flex by setting
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;
}< br> 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>