按钮失效

<?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>

    A+
发布日期:2009年12月13日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: