Austrian Pine
02-18-2008, 08:46 PM
I want to show an Alert, and have it appear over a specific control. Reading the API, I would have thought the following would work, but it places the Alert in the middle of the screen, rather than over button1. How do I have the Alert show over button1? THANKS!:)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function showAlert(event:Event) : void {
mx.controls.Alert.show("Hi there", "", (mx.controls.Alert.OK), button1);
}
]]>
</mx:Script>
<mx:Button id="button1" x="148" y="132" label="Button"/>
<mx:Button x="473" y="427" label="Button" click="showAlert(event)"/>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function showAlert(event:Event) : void {
mx.controls.Alert.show("Hi there", "", (mx.controls.Alert.OK), button1);
}
]]>
</mx:Script>
<mx:Button id="button1" x="148" y="132" label="Button"/>
<mx:Button x="473" y="427" label="Button" click="showAlert(event)"/>
</mx:Application>