no commit message

This commit is contained in:
niandeng
2020-09-17 18:40:01 +08:00
parent 4382915d09
commit d957abceaa
283 changed files with 86935 additions and 63 deletions
+43
View File
@@ -0,0 +1,43 @@
package ckaction.act {
import flash.utils.Timer;
import flash.events.TimerEvent;
public class timeInterval {
private var timer:Timer=null;
private var success:Function=null;
public function timeInterval(time:Number,fun:Function) {
// constructor code
success=fun;
timer=new Timer(time)
timer.addEventListener(TimerEvent.TIMER,timerHandler);
}
public function timerHandler(event:TimerEvent):void{
//trace("正在运行计时器",success);
success();
}
public function start():void{
if(timer && !timer.running){
timer.start();
}
}
public function stop():void{
if(timer && timer.running){
timer.stop();
}
}
public function close():void{
if(timer){
if(timer.running){
timer.stop();
}
timer.removeEventListener(TimerEvent.TIMER,timerHandler);
timer=null;
}
}
public function running():Boolean{
return timer.running;
}
}
}