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.


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

See also

Balance Board 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 BalanceBoard.
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 BalanceBoard.

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 BalanceBoard.

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 BalanceBoard.

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 BalanceBoard.

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 BalanceBoard.

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 BalanceBoard.

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