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("记时结束!");
            }
            
        }
    }
  • 相关阅读:
    Springboot + Mybatis 多数据源配置
    构建微服务:Spring boot 入门篇
    IDEA SpringBoot代码修改热部署/加载
    vue-cli知识点
    vuex知识点
    正则基本知识
    多行SQL语句拼成一条数据
    软件的版本控制
    ASP.NET 表单验证实现浅析
    建造者模式
  • 原文地址:https://www.cnblogs.com/kingfly/p/2453668.html
Copyright © 2011-2022 走看看