Flex 3 Alert text doesn't stretch to fill the gap?
This seems like a ridiculously simple question, and yet I just can't seem to find the answer.
I am trying to display some simple information in an Alert (I would rather not use an alert, but I need a quick simple solution for a project that needed to get out of the room ASAP)
In short, no matter how great I am warning, my information is never stretched and it ends up being cropped.
I can actually scroll the text with the mouse, but no good.
The picture says it all. Any ideas how to get around this? I can't imagine Alert just can't handle this.
Image here:
http://img196.imageshack.us/img196/3/bigalert.png
(I am still a new user, I cannot add it directly)
code:
var myAlert:Alert = Alert.show("The package you have selected includes a feature(s) youโve already selected. \nWe have removed the individual features for you.");
myAlert.height = 150*2;
myAlert.width = 350*2;
+2
source to share
1 answer
A quick and dirty solution.
import mx.core.mx_internal;
use namespace mx_internal;
private function showAlert():void {
var myAlert:Alert = Alert.show("The package you have selected includes a feature(s) youโve already selected. \nWe have removed the individual features for you.");
myAlert.height = 150*2;
myAlert.width = 350*2;
callLater(function():void {
var textField:IUITextField = IUITextField(myAlert.mx_internal::alertForm.mx_internal::textField);
var textFormat:TextFormat = new TextFormat();
textFormat.align = "center";
textField.width = myAlert.width;
textField.x = 0;
textField.setTextFormat(textFormat);
});
}
0
source to share