PDA

View Full Version : How to get Alert to display over a component?


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>

rt30000
02-20-2008, 09:08 PM
I am experiencing the same issue. I cannot seem to get an Alert to position off any specific component even though it looks as if it is supposed to...It always pops up on the center regardless. Anyone know the solution for us???

DjKermit
08-20-2008, 02:41 AM
Better late than never :)
Just had the same problem.

var a:Alert = Alert.show('message', 'title', 4, myDispObject);
PopUpManager.centerPopUp(a);