class org.aswing.util.Timer extends AbstractImpulser

Fires one or more action events after a specified delay. For example, an animation object can use a Timer as the trigger for drawing its frames.

Setting up a timer involves creating a Timer object, registering one or more action listeners on it, and starting the timer using the start method. For example, the following code creates and starts a timer that fires an action event once per second (as specified by the first argument to the Timer constructor). The second argument to the Timer constructor specifies a listener to receive the timer's action events.

 var delay:Number = 1000; //milliseconds
 var listener:Object = new Object();
 listener.taskPerformer = function(e:Event) {
         //...Perform a task...
     }
 var timer:Timer = new Timer(delay);
 timer.addActionListener(listener.taskPerformer);
 timer.start();

@author paling

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from AbstractImpulser

function addActionListener(listener:Dynamic ->Void?priority:Int, ?useWeakReference:Bool):Void
function getDelay():Int
function getInitialDelay():Int
function isRepeats():Bool
function isRunning():Bool
function removeActionListener(listener:Dynamic ->Void):Void
function restart():Void
function setDelay(delay:Int):Void
function setInitialDelay(initialDelay:Int):Void
function setRepeats(flag:Int):Void
function start():Void
function stop():Void

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

function new(delay:Int, ?repeatCount:Int = 0): Void

function getDelay(): Int

Returns the delay between firings of events.

@see #setDelay() @see #getInitialDelay()

function reset(): Void

function restart(): Void

function setDelay(delay:Int): Void

function start(): Void

function stop(): Void