Packageorg.aswing.util
Classpublic class AbstractImpulser
InheritanceAbstractImpulser Inheritance flash.events.EventDispatcher
ImplementsImpulser
SubclassesTimer

Provides common routines for classes implemented Impulse interface.



Protected Properties
 PropertyDefined by
  delay : uint
AbstractImpulser
  initialDelay : int
AbstractImpulser
  isInitalFire : Boolean
AbstractImpulser
  repeats : Boolean
AbstractImpulser
Public Methods
 MethodDefined by
  
AbstractImpulser(delay:uint, repeats:Boolean = true)
Constructs AbstractImpulser.
AbstractImpulser
  
addActionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds an action listener to the AbstractImpulser instance.
AbstractImpulser
  
getDelay():uint
Returns the delay between firings of events.
AbstractImpulser
  
Returns the AbstractImpulser's initial delay.
AbstractImpulser
  
isRepeats():Boolean
Returns true (the default) if the AbstractImpulser will send an action event to its listeners multiple times.
AbstractImpulser
  
isRunning():Boolean
AbstractImpulser
  
removeActionListener(listener:Function):void
Removes a action listener.
AbstractImpulser
  
restart():void
AbstractImpulser
  
setDelay(delay:uint):void
Sets the AbstractImpulser's delay between fired events.
AbstractImpulser
  
setInitialDelay(initialDelay:uint):void
Sets the AbstractImpulser's initial delay, which by default is the same as the between-event delay.
AbstractImpulser
  
setRepeats(flag:Boolean):void
If flag is false, instructs the AbstractImpulser to send only once action event to its listeners after a start.
AbstractImpulser
  
start():void
AbstractImpulser
  
stop():void
AbstractImpulser
Property detail
delayproperty
protected var delay:uint
initialDelayproperty 
protected var initialDelay:int
isInitalFireproperty 
protected var isInitalFire:Boolean
repeatsproperty 
protected var repeats:Boolean
Constructor detail
AbstractImpulser()constructor
public function AbstractImpulser(delay:uint, repeats:Boolean = true)

Constructs AbstractImpulser.

Parameters
delay:uint
 
repeats:Boolean (default = true)

Throws
— when init delay <= 0 or delay == null
Method detail
addActionListener()method
public function addActionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Adds an action listener to the AbstractImpulser instance.

Parameters
listener:Function — the listener
 
priority:int (default = 0) — the priority
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.

See also

org.aswing.event.AWEvent.ACT
getDelay()method 
public function getDelay():uint

Returns the delay between firings of events.

Returns
uint

See also

getInitialDelay()method 
public function getInitialDelay():uint

Returns the AbstractImpulser's initial delay.

Returns
uint

See also

isRepeats()method 
public function isRepeats():Boolean

Returns true (the default) if the AbstractImpulser will send an action event to its listeners multiple times.

Returns
Boolean

See also

isRunning()method 
public function isRunning():Boolean

Returns
Boolean
removeActionListener()method 
public function removeActionListener(listener:Function):void

Removes a action listener.

Parameters
listener:Function — the listener to be removed.

See also

org.aswing.event.AWEvent.ACT
restart()method 
public function restart():void
setDelay()method 
public function setDelay(delay:uint):void

Sets the AbstractImpulser's delay between fired events.

Parameters
delay:uint — the delay

Throws
— when set delay <= 0 or delay == null

See also

setInitialDelay()method 
public function setInitialDelay(initialDelay:uint):void

Sets the AbstractImpulser's initial delay, which by default is the same as the between-event delay. This is used only for the first action event. Subsequent events are spaced using the delay property.

Parameters
initialDelay:uint — the delay between the invocation of the start method and the first event fired by this impulser

Throws
— when set initialDelay <= 0 or initialDelay == null

See also

setRepeats()method 
public function setRepeats(flag:Boolean):void

If flag is false, instructs the AbstractImpulser to send only once action event to its listeners after a start.

Parameters
flag:Boolean — specify false to make the impulser stop after sending its first action event. Default value is true.
start()method 
public function start():void
stop()method 
public function stop():void