Packagecom.bourre.transitions
Interfacepublic interface TickBeacon
ImplementorsFPSBeacon, MSBeacon

Player version: Flash Player 9.0
Language version: ActionScript 3.0

A TickBeacon object is an object which provides time slicing in an application. Many objects such tweens or timed commands plug themselves on a beacon and will be noticed of time change.

The tick is the atomic unit of computation, it correspond to a step of computation in an animation. Its an equivalent to the frame unit, but, rather than using the frame as unit, which is more suitable for timeline based animation, we choose to use the tick, which is a more generic notion.

Each concret implemetation or instance of beacon could have a different atomic time entity, with different scale. For example a beacon can work with the flash player ENTER_FRAME event, with a framerate set to 40, and in parrallel there could be two others beacons, working with the setInterval function and with step respectively set to 10ms and 100ms.

The main contract defined by this interface is that all time beacons objects should register and unregister as many listeners as needed. These listeners will be noticed of time change only if the beacon is currently running (according to the isPlaying return). Each listener must implements the TickListener interface.

Concret implementation of the TickBeacon interface should take care of not registering twice an object, in order to prevent time scale breaks.

See also

TickListener.html


Public Methods
 MethodDefined by
  
Adds the passed-in listener as listener for this TickBeacon.
TickBeacon
  
isPlaying():Boolean
Returns true if this beacon object is currently running.
TickBeacon
  
Removes the passed-in listener from listening for this beacon's event.
TickBeacon
  
start():void
Starts this beacon if it wasn't already nunning.
TickBeacon
  
stop():void
Stops this beacon if it wasn't already stopped.
TickBeacon
Method detail
addTickListener()method
public function addTickListener(listener:TickListener):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in listener as listener for this TickBeacon. Concret implementations should start themselves when a first listener is added. That behavior ensure that there's no running beacon which have no listeners registered. It also guarantee that an object will immediatly run when it add itself as listener.

Concret implementation should not register an object which was already a listener of this beacon.

Parameters
listener:TickListener — tick listener to be added
isPlaying()method 
public function isPlaying():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this beacon object is currently running.

Returns
Booleantrue if this beacon object is currently running
removeTickListener()method 
public function removeTickListener(listener:TickListener):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener from listening for this beacon's event. Concret implementations should stop themselves when the last listener is removed. That behavior ensure that there's no running beacon which have no listeners registered.

Parameters
listener:TickListener — tick listener to be removed
start()method 
public function start():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Starts this beacon if it wasn't already nunning.

stop()method 
public function stop():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Stops this beacon if it wasn't already stopped.