Packagecom.eqsim.components
Classpublic class SimpleTimer
InheritanceSimpleTimer Inheritance fl.core.UIComponent

This class implements a countdown timer.

The class has one event, by default called "onElapsed" (but this can be changed in the property inspector, or programmatically via evtElapsed). The value is the number of remaining iterations until shut down (-1 is infinite).



Public Properties
 PropertyDefined By
  active : Boolean
Set this value to start or stop the timing interval.
SimpleTimer
  evtElapsed : String = onElapsed
This property holds the string name of the event.
SimpleTimer
  interval : int
Set this value to change the timing interval.
SimpleTimer
  numIterations : int
Set this value to change the number of times the timer repeats the interval.
SimpleTimer
Protected Properties
 PropertyDefined By
  _interval : int = 1000
SimpleTimer
  intTimer : Timer
SimpleTimer
  _loopCt : Number
SimpleTimer
  _numIterations : int = 0
SimpleTimer
  origHeight : Number
SimpleTimer
  origWidth : Number
SimpleTimer
  previewBox : MovieClip
SimpleTimer
  SimpleTimerPreviewClip : Class
SimpleTimer
Public Methods
 MethodDefined By
  
SimpleTimer
  
destroy():void
Remove this component's associated listeners and memory.
SimpleTimer
  
pause():void
SimpleTimer
  
reset():void
SimpleTimer
  
start():void
SimpleTimer
Protected Methods
 MethodDefined By
  
configUI():void
[override] configUI Get the display objects created in preparation of launch.
SimpleTimer
  
draw():void
[override]
SimpleTimer
  
elapsed(te:TimerEvent):void
SimpleTimer
Events
 Event Summary Defined By
  Event generated when interval elapses.SimpleTimer
Property Detail
_intervalproperty
protected var _interval:int = 1000

_loopCtproperty 
protected var _loopCt:Number

_numIterationsproperty 
protected var _numIterations:int = 0

activeproperty 
active:Boolean

Set this value to start or stop the timing interval. If changed while the timer is active, the timer resets and starts again.


Implementation
    public function get active():Boolean
    public function set active(value:Boolean):void
evtElapsedproperty 
public var evtElapsed:String = onElapsed

This property holds the string name of the event.

intervalproperty 
interval:int

Set this value to change the timing interval. If changed while the timer is active, the timer resets and starts again.


Implementation
    public function get interval():int
    public function set interval(value:int):void
intTimerproperty 
protected var intTimer:Timer

numIterationsproperty 
numIterations:int

Set this value to change the number of times the timer repeats the interval. If changed while the timer is active, the timer resets and starts again. If the value is 0, the timer repeats the interval indefinitely.


Implementation
    public function get numIterations():int
    public function set numIterations(value:int):void
origHeightproperty 
protected var origHeight:Number

origWidthproperty 
protected var origWidth:Number

previewBoxproperty 
protected var previewBox:MovieClip

SimpleTimerPreviewClipproperty 
protected var SimpleTimerPreviewClip:Class

Constructor Detail
SimpleTimer()Constructor
public function SimpleTimer()

Method Detail
configUI()method
override protected function configUI():void

configUI Get the display objects created in preparation of launch. Note that we get called before our constructor, and before we are notified that we are on the stage!

destroy()method 
public function destroy():void

Remove this component's associated listeners and memory.

draw()method 
override protected function draw():void

elapsed()method 
protected function elapsed(te:TimerEvent):void

Parameters

te:TimerEvent

pause()method 
public function pause():void

reset()method 
public function reset():void

start()method 
public function start():void

Event Detail
onElapsed Event

Event generated when interval elapses. Value supplied with the event (data) is the number of remaining iterations until shutdown (0 means loop infinitely).