MSBeacon

Kind of class:public class
Package:com.bourre.transitions
Inherits from:none
Implements:
Classpath:com.bourre.transitions.MSBeacon
File last modified:Monday, 24 November 2008, 11:36:57

Summary


Constructor
Class methods
  • getInstance : MSBeacon
    • Provides an access to a global instance of the
  • release : void
    • Stops and the delete the current global instance
Instance methods
  • start : void
    • Starts this beacon if it wasn't already playing.
  • stop : void
    • Stops this beacon if it wasn't already stopped.
  • isPlaying : Boolean
    • Returns true if this beacon is currently running.
  • addTickListener (listener:TickListener) : void
    • Adds the passed-in listener as listener for
  • removeTickListener (listener:TickListener) : void
    • Removes the passed-in listener as listener
  • timeHandler (e:TimerEvent = null) : void
    • Handles the TIMER from the internal
  • setTickDelay (n:Number = 25) : void
    • Defines the preferred delay to occurs between two ticks.
  • getTickDelay : Number
    • Returns the current delay in milliseconds between ticks.
  • setTickPerSecond (n:Number = 40) : void
    • Sets the delay between ticks by defining the number of
  • getTickPerSecond : Number
    • Returns the number of ticks per seconds which may
  • toString : String
    • Returns the string representation of this object.

Constructor

MSBeacon

public function MSBeacon (
)

Creates a new MSBeacon.

Class methods

getInstance

public static function getInstance (

Provides an access to a global instance of the

MSBeacon class. That doesn't mean
that the MSBeacon class is a singleton, it simplify
the usage of that beacon into concret TickListenerimplementation, which would register to a MSBeacon instance.
Returns:
  • a global instance of the MSBeacon class

release

public static function release (
) : void

Stops and the delete the current global instance
of the MSBeacon class.

Instance methods

addTickListener

public function addTickListener (
listener:TickListener) : void

Adds the passed-in listener as listener for
this TickBeacon. If the passed-in listener
is the first listener added to this beacon, the beacon
will automatically start itself.
Parameters:
listener:
tick listener to be added

getTickDelay

public function getTickDelay (
) : Number

Returns the current delay in milliseconds between ticks.
Returns:
  • the current delay in milliseconds between ticks

getTickPerSecond

public function getTickPerSecond (
) : Number

Returns the number of ticks per seconds which may
occurs with the current delay.
Returns:
  • the number of ticks per seconds which may
    occurs with the current delay

isPlaying

public function isPlaying (
) : Boolean

Returns true if this beacon is currently running.
A MSBeacon is considered as running when it receive events
from its internal Timer object.
Returns:
  • true if this beacon is currently running
Specified by:

removeTickListener

public function removeTickListener (
listener:TickListener) : void

Removes the passed-in listener as listener
for this TickBeacon. If the passed-in listener
is the last listener registered to this beacon, the beacon
will automatically stop itself.
Parameters:
listener:
tick listener to be removed

setTickDelay

public function setTickDelay (
n:Number = 25) : void

Defines the preferred delay to occurs between two ticks.
There's no guarantee on the regularity of the delay, as
the Flash player can restrict the delay to match the
framerate defined for the compiled swf.
Parameters:
n:
number of milliseconds between each tick

setTickPerSecond

public function setTickPerSecond (
n:Number = 40) : void

Sets the delay between ticks by defining the number of
ticks per seconds to occurs. As with the setTickDelaymethod, there's no guarantee that the observed delay
was conform to the specified one.
Parameters:
n:
number of ticks per seconds

start

public function start (
) : void

Starts this beacon if it wasn't already playing.
Specified by:

stop

public function stop (
) : void

Stops this beacon if it wasn't already stopped.
Specified by:

timeHandler

public function timeHandler (
e:TimerEvent = null) : void

Handles the TIMER from the internal

Timer object, and dispatch the onTickevent to its listeners.
Parameters:
e:
event dispatched by the Timer object

toString

public function toString (
) : String

Returns the string representation of this object.
Returns:
  • the string representation of this object.