| Package | com.bourre.transitions |
| Class | public class MSBeacon |
| Implements | TickBeacon |
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
MSBeacon provides tick to its listeners based
on the native TIMER event. A Timer
object is instanciated internally to provide that callback.
By comparison with the FPSBeacon the number of
ticks per second is relatively independant of the flash player
framerate, as said in the Timer class documentation :
For example, if a SWF file is set to play at 10 frames per second (fps), which is 100 millisecond intervals, but your timer is set to fire an event at 80 milliseconds, the event will be dispatched close to the 100 millisecond interval. Applications may dispatch events at slightly offset intervals based on the internal frame rate of the application. Memory-intensive scripts may also offset the events.
The MSBeacon provides an access to a global instance
of the class, concret TickListener may use that instance
by default when starting or stopping their animations.
See also
| Method | Defined by | ||
|---|---|---|---|
|
MSBeacon()
Creates a new
MSBeacon. | MSBeacon | ||
|
addTickListener(listener:TickListener):void
Adds the passed-in
listener as listener for
this TickBeacon. | MSBeacon | ||
|
[static]
Provides an access to a global instance of the
MSBeacon class. | MSBeacon | ||
|
getTickDelay():Number
Returns the current delay in milliseconds between ticks.
| MSBeacon | ||
|
getTickPerSecond():Number
Returns the number of ticks per seconds which may
occurs with the current delay.
| MSBeacon | ||
|
isPlaying():Boolean
Returns
true if this beacon is currently running. | MSBeacon | ||
|
release():void
[static]
Stops and the delete the current global instance
of the
MSBeacon class. | MSBeacon | ||
|
removeTickListener(listener:TickListener):void
Removes the passed-in
listener as listener
for this TickBeacon. | MSBeacon | ||
|
setTickDelay(n:Number = 25):void
Defines the preferred delay to occurs between two ticks.
| MSBeacon | ||
|
setTickPerSecond(n:Number = 40):void
Sets the delay between ticks by defining the number of
ticks per seconds to occurs.
| MSBeacon | ||
|
start():void
Starts this beacon if it wasn't already playing.
| MSBeacon | ||
|
stop():void
Stops this beacon if it wasn't already stopped.
| MSBeacon | ||
|
timeHandler(e:TimerEvent = null):void
Handles the
TIMER from the internal
Timer object, and dispatch the onTick
event to its listeners. | MSBeacon | ||
|
toString():String
Returns the string representation of this object.
| MSBeacon | ||
| MSBeacon | () | constructor |
public function MSBeacon()
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Creates a new MSBeacon.
| 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. If the passed-in listener
is the first listener added to this beacon, the beacon
will automatically start itself.
listener:TickListener — tick listener to be added
|
| getInstance | () | method |
public static function getInstance():MSBeacon
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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 TickListener
implementation, which would register to a MSBeacon instance.
MSBeacon —
a global instance of the MSBeacon class
|
| getTickDelay | () | method |
public function getTickDelay():Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the current delay in milliseconds between ticks.
ReturnsNumber — the current delay in milliseconds between ticks
|
| getTickPerSecond | () | method |
public function getTickPerSecond():Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the number of ticks per seconds which may occurs with the current delay.
ReturnsNumber — the number of ticks per seconds which may
occurs with the current delay
|
| isPlaying | () | method |
public function isPlaying():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if this beacon is currently running.
A MSBeacon is considered as running when it receive events
from its internal Timer object.
Boolean — true if this beacon is currently running
|
| release | () | method |
public static function release():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Stops and the delete the current global instance
of the MSBeacon class.
| removeTickListener | () | method |
public function removeTickListener(listener:TickListener):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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.
listener:TickListener — tick listener to be removed
|
| setTickDelay | () | method |
public function setTickDelay(n:Number = 25):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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.
Parametersn:Number (default = 25) — number of milliseconds between each tick
|
| setTickPerSecond | () | method |
public function setTickPerSecond(n:Number = 40):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Sets the delay between ticks by defining the number of
ticks per seconds to occurs. As with the setTickDelay
method, there's no guarantee that the observed delay
was conform to the specified one.
n:Number (default = 40) — number of ticks per seconds
|
| 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 playing.
| 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.
| timeHandler | () | method |
public function timeHandler(e:TimerEvent = null):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Handles the TIMER from the internal
Timer object, and dispatch the onTick
event to its listeners.
e:TimerEvent (default = null) — event dispatched by the Timer object
|
| toString | () | method |
public function toString():String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the string representation of this object.
ReturnsString — the string representation of this object.
|