Airxbc is a native extension that allows the use of XBox 360 controllers. The extension has support for multiple controllers and it can track the left/right thumbstick buttons, as well as all other buttons in the controller.

It is possible to check if a button is pressed or was released, as well as check if it was just pressed (useful for single hit checks). The extension can be used with up to four controllers at the same time.


import com.rhuno.Airxbc;  
import com.rhuno.X360Gamepad;  

var ext:Airxbc = new Airxbc();  
var gpad0:X360Gamepad;  
var gpad1:X360Gamepad;

gpad0 = ext.pollGamePad();  // index 0 is used if no parameter is supplied
gpad1 = ext.pollGamePad(1);  

// various ways of checking for button presses  

// ways of checking if a button was just pressed  

// ways of checking for button releases  

// get trigger value  
var value:int = gpad0.leftTrigger;  

// get trigger percentage (0 thru 1)  
var percent:Number = gpad0.leftTriggerAsPercent;  

// NOTE: you still use the extension to set vibration  
ext.setVibration(0, 0.5, 0.5); // vibrate the first controller at half speed on both motors
Air Native Extension, Windows. URL.