Alert control sizes itself to fit its text, buttons, and icon

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.controls.Alert;
public var myAlert:Alert;
private function openAlert():void {
myAlert = Alert.show("this is a test", "Alert", Alert.OK | Alert.CANCEL);
myAlert.height=150;
myAlert.width=150;
}
</mx:Script>
<mx:TextInput id="myInput" width="150" text="" />
<mx:Button id="myButton" label="Copy Text" click="openAlert();" />
<mx:TextInput id="myText" />
</mx:Application>
Related examples in the same category