<?xml version="1.0" encoding="utf-8"?>
<mx:Application name="Alert_enabled_test"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.managers.PopUpManager;
private const ENABLE_DELAY:uint = 3000; // 3 seconds
private var a:Alert;
private function showAlert():void {
a = Alert.show("You have been logged out.", "Goodbye");
a.enabled = false;
setTimeout(enableAlert, ENABLE_DELAY, a);
}
private function enableAlert(target:Alert):void {
target.enabled = true;
// PopUpManager.removePopUp(target);
}
]]>
</mx:Script>
<mx:Button id="button"
label="Logout"
click="showAlert();" />
</mx:Application>