Flash AS2 事件处理机制(19) } //------------------------------ public function reset():Void { this._currentCount = 0; this.stop(); } public function start():Void { this._timerID = setInterval(Delegate.create(this, this.startTimer), this._delay); this._running = true; } public function stop():Void { clearInterval(this._timerID); this._running = false; } public function toString():String { return "[EDTimer]"; } //---------------------------------------- private function startTimer():Void { this._currentCount++; this.dispatchEvent({type:"timer", currentCount:this._currentCount}); if (this._currentCount == this._repeatCount) { this.reset(); this.dispatchEvent({type:"timerComplete"}); } } //------------------------------ public function get delay():Number { return this._delay; } public function set delay(d:Number):Void {