zoukankan      html  css  js  c++  java
  • 【AS3代码】Timer计时器用法

    package
    {
        import flash.display.Sprite;
        import flash.events.TimerEvent;
        import flash.utils.Timer;
        public class Main extends Sprite
        {    
            private var a:Timer = new Timer(1000);
            public function Main():void
            {
                a.delay = 500;         //时间延迟半秒
                a.repeatCount = 10;        //一共运行10次
                a.addEventListener(TimerEvent.TIMER, yunxing);    //运行时调用
                a.addEventListener(TimerEvent.TIMER_COMPLETE, jieshu);    //运行结束时调用
                a.start();    //启动计时器
            }        
            //运行时
            private function yunxing(evt:TimerEvent):void
            {
                trace("当前已触发次数:" + a.currentCount);
            }
            //运行结束后
            private function jieshu(evt:TimerEvent):void
            {
                trace("记时结束!");
            }
            
        }
    }
  • 相关阅读:
    Luogu P3371 线段树1
    8-16模拟赛
    Luogu P1313 计算系数
    Luogu P1525 关押罪犯
    Luogu P1040 加分二叉树
    Luogu P1018 乘积最大
    Luogu P1541 乌龟棋
    BST,Splay平衡树学习笔记
    常见的逻辑错误
    行为认知疗法——十大认知错误
  • 原文地址:https://www.cnblogs.com/kingfly/p/2453668.html
Copyright © 2011-2022 走看看