Packagegraphics.transitions
Classpublic class Timer
InheritanceTimer Inheritance flash.utils.Timer
Implements ITimer

This class extends the flash.utils.Timer class and implement the graphics.transitions.ITimer class. The Timer class is the interface to Flash Player timers. You can create new Timer objects to run code on a specified time sequence. Use the start() method to start a timer. Add an event listener for the timer event to set up code to be run on the timer interval.

Example :

     package examples 
     {
         import graphics.transitions.Timer;
         
         import flash.display.Sprite;
         import flash.events.KeyboardEvent;
         import flash.events.TimerEvent;
         
         public class ExampleTimer extends Sprite
         {
             public function ExampleTimer()
             {
                 stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
                 
                 timer = new graphics.transitions.Timer( 3000, 2 );
                 
                 timer.addEventListener( TimerEvent.TIMER , timerHandler);
                 timer.addEventListener( TimerEvent.TIMER_COMPLETE , timerHandler);
                 
                 timer.start();
             }
             
             public var timer:Timer ;
             
             public function timerHandler(event:TimerEvent):void 
             {
                 trace( timer.currentCount + " " + event.type  );
             }
             
             public function keyDown( e:KeyboardEvent ):void
             {
                 timer.reset() ;
                 timer.start() ;
             }
         }
     }
     



Public Properties
 PropertyDefined By
  complete : Signaler
[read-only] The timer complete signal reference.
Timer
  timer : Signaler
[read-only] The timer signal reference.
Timer
Public Methods
 MethodDefined By
  
Timer(delay:Number, repeatCount:int = 0)
Constructs a new Timer object with the specified delay and repeatCount states.
Timer
Property Detail
completeproperty
complete:Signaler  [read-only]

The timer complete signal reference.


Implementation
    public function get complete():Signaler
timerproperty 
timer:Signaler  [read-only]

The timer signal reference.


Implementation
    public function get timer():Signaler
Constructor Detail
Timer()Constructor
public function Timer(delay:Number, repeatCount:int = 0)

Constructs a new Timer object with the specified delay and repeatCount states. The timer does not start automatically; you must call the start() method to start it.

Parameters
delay:Number — The delay between timer events, in milliseconds.
 
repeatCount:int (default = 0) — Specifies the number of repetitions. If zero, the timer repeats infinitely. If nonzero, the timer runs the specified number of times and then stops.