|
Flash AS2 事件处理机制(20) this._delay = d; } public function get repeatCount():Number { return this._repeatCount; } public function set repeatCount(r:Number):Void { this._repeatCount = r; } public function get currentCount():Number { return this._currentCount; } public function get running():Boolean { return this._running; } //------------------------------ } 因此类详细前面已讲,功能一样,只是事件处理机制不同而已.这里就不再啰嗦.
示例类: 打开 EDTimerExample.as 文档,输入下面的代码:
import AS2.utils.EDTimer; //---------------------------------------- class EDTimerExample { //---------------------------------------- public function EDTimerExample() { var te:EDTimer = new EDTimer(1000, 5); te.addEventListener("timer", this); te.addEventListener("timerComplete", this); te.start(); } private function timer(evt:Object):Void { trace("timer: " + evt.currentCount); } private function timerComplete(evt:Object):Void { trace(evt.type); } //----------------------------------------
|