Alert Box customization

1) Prevent scroll of alert message in case of more text

import mx.controls.Alert;
use namespace mx_internal;
private var alert:Alert;

private function preventAlertContentScroll():void
{
alert = Alert.show(‘Long alert message causing scroll in text on mousewheel and I want to prevent that. ‘);
alert.mx_internal::alertForm.mx_internal::textField.mouseEnabled = false;
}

2) Styling of Alert Text

In Style Tag , define class based style and for specific style to the text content use messageStyleName.

– Alert
{
messageStyleName: “alertMessage”;
}

.alertMessage
{
letterSpacing: 0;
fontSize: 10;
fontWeight: normal;
color: black;
}

There are some more styles related to the Alert control.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: