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
Provides an access to a global instance of the
that the MSBeacon class is a singleton, it simplify
the usage of that beacon into concret
MSBeacon class. That doesn't meanthat 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
MSBeaconclass
release
public static function release (
) : void
Stops and the delete the current global instance
of the
of the
MSBeacon class. Instance methods
addTickListener
Adds the passed-in
this
is the first listener added to this beacon, the beacon
will automatically start itself.
listener as listener forthis
TickBeacon. If the passed-in listeneris the first listener added to this beacon, the beacon
will automatically start itself.
Parameters:
listener:
tick listener to be added
Specified by:
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.
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
A MSBeacon is considered as running when it receive events
from its internal
true if this beacon is currently running.A MSBeacon is considered as running when it receive events
from its internal
Timer object. Returns:
-
trueif this beacon is currently running
Specified by:
removeTickListener
Removes the passed-in
for this
is the last listener registered to this beacon, the beacon
will automatically stop itself.
listener as listener for this
TickBeacon. If the passed-in listeneris the last listener registered to this beacon, the beacon
will automatically stop itself.
Parameters:
listener:
tick listener to be removed
Specified by:
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.
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
was conform to the specified one.
ticks per seconds to occurs. As with the
setTickDelaymethod, there's no guarantee that the observed delaywas 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 internalTimer 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.