flex定时器

发布时间:2009-11-28 00:13:24 阅读:1171次

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">
     <mx:Script>
         <![CDATA[
             import mx.controls.Alert;
             private var alert:Alert;
             private function delayedAlert():void {
                 var num:Number;
                 flash.utils.setTimeout(launchAlert, 2000);
                 button.enabled = false;
             }
             private function launchAlert():void {
                 alert = Alert.show("I'm an alert.");
                 button.enabled = true;
             }
         ]]>
     </mx:Script>
    <mx:Button id="button"
            label="Click here to launch alert (2 second delay)"
            click="delayedAlert();" />
</mx:Application>

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
下一篇:flex中倒计时

转载请注明:flex定时器 出自老鄢博客 | 欢迎分享