| Package | org.wiiflash |
| Class | public final class Nunchuk |
| Implements | flash.events.IEventDispatcher |
nunchuk property of a Wiimote object.
var wiimote: Wiimote = new Wiimote(); myWiimote.addEventListener( WiimoteEvent.NUNCHUK_CONNECT, onNunchukConnected ); myWiimote.addEventListener( WiimoteEvent.NUNCHUK_DISCONNECT, onNunchukDisconnected );
myWiimote.nunchuk.addEventListener ( ButtonEvent.C_PRESS, onCPress ); myWiimote.nunchuk.addEventListener ( ButtonEvent.C_RELEASE, onCRelease );
See also
| Property | Defined by | ||
|---|---|---|---|
| c : Boolean [read-only]
Indicates if button C is pressed.
| Nunchuk | ||
| pitch : Number [read-only]
Pitch angle of the Wiimote in radians.
| Nunchuk | ||
| roll : Number [read-only]
Roll angle of the Wiimote in radians.
| Nunchuk | ||
| sensorX : Number [read-only]
Value of the x acceleration sensor.
| Nunchuk | ||
| sensorY : Number [read-only]
Value of the y acceleration sensor.
| Nunchuk | ||
| sensorZ : Number [read-only]
Value of the z acceleration sensor.
| Nunchuk | ||
| stickX : Number [read-only]
Value of the x stick-axis.
| Nunchuk | ||
| stickY : Number [read-only]
Value of the y stick-axis.
| Nunchuk | ||
| yaw : Number [read-only]
Yaw angle of the Nunchuk in radians.
| Nunchuk | ||
| z : Boolean [read-only]
Indicates if button Z is pressed.
| Nunchuk | ||
| Method | Defined by | ||
|---|---|---|---|
|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with a Nunchuk object so that the listener receives notification of an event.
| Nunchuk | ||
|
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
| Nunchuk | ||
|
hasEventListener(type:String):Boolean
Checks whether the Nunchuk object has any listeners registered for a specific type of event.
| Nunchuk | ||
|
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the Nunchuk object.
| Nunchuk | ||
|
toString():String
Returns the string representation of the specified object.
| Nunchuk | ||
|
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this Nunchuk object or any of its ancestors for the specified event type.
| Nunchuk | ||
| c | property |
c:Boolean [read-only]Indicates if button C is pressed.
Implementation public function get c():Boolean
| pitch | property |
pitch:Number [read-only]Pitch angle of the Wiimote in radians. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get pitch():Number
| roll | property |
roll:Number [read-only]Roll angle of the Wiimote in radians. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get roll():Number
| sensorX | property |
sensorX:Number [read-only]Value of the x acceleration sensor. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get sensorX():Number
| sensorY | property |
sensorY:Number [read-only]Value of the y acceleration sensor. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get sensorY():Number
| sensorZ | property |
sensorZ:Number [read-only]Value of the z acceleration sensor. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get sensorZ():Number
| stickX | property |
stickX:Number [read-only]Value of the x stick-axis. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get stickX():Number
| stickY | property |
stickY:Number [read-only]Value of the y stick-axis. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get stickY():Number
| yaw | property |
yaw:Number [read-only]Yaw angle of the Nunchuk in radians. This value is scaled by the calibration data that has been read from the Nunchuk.
Implementation public function get yaw():Number
| z | property |
z:Boolean [read-only]Indicates if button Z is pressed.
Implementation public function get z():Boolean
| addEventListener | () | method |
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):voidRegisters an event listener object with a Nunchuk object so that the listener receives notification of an event.
Parameterstype: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):BooleanDispatches an event into the event flow.
Parametersevent:Event — The Event object dispatched into the event flow.
|
Boolean |
See also
| hasEventListener | () | method |
public function hasEventListener(type:String):BooleanChecks whether the Nunchuk object has any listeners registered for a specific type of event.
Parameterstype:String — The type of event.
|
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):voidRemoves a listener from the Nunchuk object.
Parameterstype: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():StringReturns the string representation of the specified object.
ReturnsString — A string representation of the object.
|
| willTrigger | () | method |
public function willTrigger(type:String):BooleanChecks whether an event listener is registered with this Nunchuk object or any of its ancestors for the specified event type.
Parameterstype:String — The type of event.
|
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
|
See also