Packageorg.wiiflash
Classpublic final class BalanceBoard
Implementsflash.events.IEventDispatcher

The BalanceBoard class represents a Balance Board. A BalanceBoard object can not be created manually. The only access to a BalanceBoard is by using the balanceBoard property of a Wiimote object.

Note : Even if the Balance Board is not physically attached to a Wiimote, the Balance Board is built on top of a Wiimote which handles all the Bluetooth communication. That's the reason why we consider the Balance Board as an extension like the Nunchuk, or the Classic Controller.


Example
This example shows how to check if the Balance Board has been detected :
  
  var wiimote:Wiimote = new Wiimote();
  myWiimote.addEventListener( WiimoteEvent.BalanceBoard_CONNECT, onBalanceBoardConnected );
  myWiimote.addEventListener( WiimoteEvent.BalanceBoard_DISCONNECT, onBalanceBoardDisconnected );
  

See also

BalanceBoard description on wiili.org
org.wiiflash.BalanceBoard


Public Properties
 PropertyDefined by
  bottomLeftKg : Number
[read-only] Value of the bottom left sensor.
BalanceBoard
  bottomRightKg : Number
[read-only] Value of the bottom right sensor.
BalanceBoard
  centerOfGravity : Point
[read-only] Current center of gravity on the Balance Board.
BalanceBoard
  topLeftKg : Number
[read-only] Value of the top left sensor.
BalanceBoard
  topRightKg : Number
[read-only] Value of the top right sensor.
BalanceBoard
  totalKg : Number
[read-only] Total Kg on the Balance Board This value is scaled by the calibration data that has been read from the Balance Board.
BalanceBoard
Public Methods
 MethodDefined by
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with a BalanceBoard object so that the listener receives notification of an event.
BalanceBoard
  
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
BalanceBoard
  
hasEventListener(type:String):Boolean
Checks whether the BalanceBoard object has any listeners registered for a specific type of event.
BalanceBoard
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the BalanceBoard object.
BalanceBoard
  
toString():String
Returns the string representation of the specified object.
BalanceBoard
  
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this BalanceBoard object or any of its ancestors for the specified event type.
BalanceBoard
Property detail
bottomLeftKgproperty
bottomLeftKg:Number  [read-only]

Value of the bottom left sensor. This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get bottomLeftKg():Number
bottomRightKgproperty 
bottomRightKg:Number  [read-only]

Value of the bottom right sensor. This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get bottomRightKg():Number
centerOfGravityproperty 
centerOfGravity:Point  [read-only]

Current center of gravity on the Balance Board. Expressed a Point with x and y gravity. This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get centerOfGravity():Point
topLeftKgproperty 
topLeftKg:Number  [read-only]

Value of the top left sensor. This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get topLeftKg():Number
topRightKgproperty 
topRightKg:Number  [read-only]

Value of the top right sensor. This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get topRightKg():Number
totalKgproperty 
totalKg:Number  [read-only]

Total Kg on the Balance Board This value is scaled by the calibration data that has been read from the Balance Board.

Implementation
    public function get totalKg():Number
Method detail
addEventListener()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Registers an event listener object with a BalanceBoard object so that the listener receives notification of an event.

Parameters
type:String — The type of event.
 
listener:Function — The listener function that processes the event.
 
useCapture:Boolean (default = false) — Determines whether the listener works in the capture phase or the target and bubbling phases.
 
priority:int (default = 0) — The priority level of the event listener.
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.

See also

dispatchEvent()method 
public function dispatchEvent(event:Event):Boolean

Dispatches an event into the event flow.

Parameters
event:Event — The Event object dispatched into the event flow.

Returns
Boolean

See also

hasEventListener()method 
public function hasEventListener(type:String):Boolean

Checks whether the BalanceBoard object has any listeners registered for a specific type of event.

Parameters
type:String — The type of event.

Returns
Boolean — A value of true if a listener of the specified type is registered; false otherwise.

See also

removeEventListener()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Removes a listener from the BalanceBoard object.

Parameters
type:String — The type of event.
 
listener:Function — The listener object to remove.
 
useCapture:Boolean (default = false) — Specifies whether the listener was registered for the capture phase or the target and bubbling phases.

See also

toString()method 
public function toString():String

Returns the string representation of the specified object.

Returns
String — A string representation of the object.
willTrigger()method 
public function willTrigger(type:String):Boolean

Checks whether an event listener is registered with this BalanceBoard object or any of its ancestors for the specified event type.

Parameters
type:String — The type of event.

Returns
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.

See also