FLEX:使用setTimeout,setInterval ,实现sleep功能(转)
生活随笔
收集整理的這篇文章主要介紹了
FLEX:使用setTimeout,setInterval ,实现sleep功能(转)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| <?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 { 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> |
轉載于:https://www.cnblogs.com/timoli/archive/2009/06/16/1503951.html
總結
以上是生活随笔為你收集整理的FLEX:使用setTimeout,setInterval ,实现sleep功能(转)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: shell 的here document
- 下一篇: VS无法运行调试