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

The ClassicController class represents a Classic Controller. A ClassicController object can not be created manually. The only access to a ClassicController is by using the classicController property of a Wiimote object.


Example
This example shows how to check if the Classic Controller has been plugged to the Wiimote :
  
  var wiimote:Wiimote = new Wiimote();
  myWiimote.addEventListener( WiimoteEvent.CONTROLLER_CONNECT, onClassicControllerConnected );
  myWiimote.addEventListener( WiimoteEvent.CONTROLLER_DISCONNECT, onClassicControllerDisconnected );
  
This example shows how to listen for events from the HOME button:
  
  myWiimote.classicController.addEventListener( ButtonEvent.HOME_PRESS, onHomePress );
  myWiimote.classicController.addEventListener( ButtonEvent.HOME_RELEASE, onHomeRelease );
  

See also

Classic Controller description on wiili.org
org.wiiflash.ClassicController


Public Properties
 PropertyDefined by
  a : Boolean
[read-only] Indicates if button A is pressed.
ClassicController
  b : Boolean
[read-only] Indicates if button B is pressed.
ClassicController
  down : Boolean
[read-only] Indicates if button Down is pressed.
ClassicController
  home : Boolean
[read-only] Indicates if button Home is pressed.
ClassicController
  l : Boolean
[read-only] Indicates if button L is pressed.
ClassicController
  left : Boolean
[read-only] Indicates if button Left is pressed.
ClassicController
  minus : Boolean
[read-only] Indicates if button - is pressed.
ClassicController
  plus : Boolean
[read-only] Indicates if button + is pressed.
ClassicController
  r : Boolean
[read-only] Indicates if button R is pressed.
ClassicController
  right : Boolean
[read-only] Indicates if button Right is pressed.
ClassicController
  stickXLeft : Number
[read-only] Value of the xleft stick-axis.
ClassicController
  stickXRight : Number
[read-only] Value of the x right stick-axis.
ClassicController
  stickYLeft : Number
[read-only] Value of the yleft stick-axis.
ClassicController
  stickYRight : Number
[read-only] Value of the yright stick-axis.
ClassicController
  up : Boolean
[read-only] Indicates if button Up is pressed.
ClassicController
  x : Boolean
[read-only] Indicates if button X is pressed.
ClassicController
  y : Boolean
[read-only] Indicates if button Y is pressed.
ClassicController
  zL : Boolean
[read-only] Indicates if button zL is pressed.
ClassicController
  zR : Boolean
[read-only] Indicates if button zR is pressed.
ClassicController
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 ClassicController object so that the listener receives notification of an event.
ClassicController
  
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
ClassicController
  
hasEventListener(type:String):Boolean
Checks whether the ClassicController object has any listeners registered for a specific type of event.
ClassicController
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the ClassicController object.
ClassicController
  
toString():String
Returns the string representation of the specified object.
ClassicController
  
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this ClassicController object or any of its ancestors for the specified event type.
ClassicController
Property detail
aproperty
a:Boolean  [read-only]

Indicates if button A is pressed.

Implementation
    public function get a():Boolean
bproperty 
b:Boolean  [read-only]

Indicates if button B is pressed.

Implementation
    public function get b():Boolean
downproperty 
down:Boolean  [read-only]

Indicates if button Down is pressed.

Implementation
    public function get down():Boolean
homeproperty 
home:Boolean  [read-only]

Indicates if button Home is pressed.

Implementation
    public function get home():Boolean
lproperty 
l:Boolean  [read-only]

Indicates if button L is pressed.

Implementation
    public function get l():Boolean
leftproperty 
left:Boolean  [read-only]

Indicates if button Left is pressed.

Implementation
    public function get left():Boolean
minusproperty 
minus:Boolean  [read-only]

Indicates if button - is pressed.

Implementation
    public function get minus():Boolean
plusproperty 
plus:Boolean  [read-only]

Indicates if button + is pressed.

Implementation
    public function get plus():Boolean
rproperty 
r:Boolean  [read-only]

Indicates if button R is pressed.

Implementation
    public function get r():Boolean
rightproperty 
right:Boolean  [read-only]

Indicates if button Right is pressed.

Implementation
    public function get right():Boolean
stickXLeftproperty 
stickXLeft:Number  [read-only]

Value of the xleft stick-axis. This value is scaled by the calibration data that has been read from the ClassicController.

Implementation
    public function get stickXLeft():Number
stickXRightproperty 
stickXRight:Number  [read-only]

Value of the x right stick-axis. This value is scaled by the calibration data that has been read from the ClassicController.

Implementation
    public function get stickXRight():Number
stickYLeftproperty 
stickYLeft:Number  [read-only]

Value of the yleft stick-axis. This value is scaled by the calibration data that has been read from the ClassicController.

Implementation
    public function get stickYLeft():Number
stickYRightproperty 
stickYRight:Number  [read-only]

Value of the yright stick-axis. This value is scaled by the calibration data that has been read from the ClassicController.

Implementation
    public function get stickYRight():Number
upproperty 
up:Boolean  [read-only]

Indicates if button Up is pressed.

Implementation
    public function get up():Boolean
xproperty 
x:Boolean  [read-only]

Indicates if button X is pressed.

Implementation
    public function get x():Boolean
yproperty 
y:Boolean  [read-only]

Indicates if button Y is pressed.

Implementation
    public function get y():Boolean
zLproperty 
zL:Boolean  [read-only]

Indicates if button zL is pressed.

Implementation
    public function get zL():Boolean
zRproperty 
zR:Boolean  [read-only]

Indicates if button zR is pressed.

Implementation
    public function get zR():Boolean
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 ClassicController 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 ClassicController 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 ClassicController 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 ClassicController 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