Skip to main content
Adobe Employee
April 5, 2013
Question

GameInput APIs in Adobe AIR 3.7

  • April 5, 2013
  • 2 replies
  • 4058 views

The GameInput API is an interface that allows applications to communicate with attached game input devices (joysticks, gamepads, wands, etc). This API is only supported on Android devices running on OS version 4.1 or higher. This feature can only be used with namespace 3.7 or greater and requires the minimum swf version to be equal or greater than 20.

For more details on GameInput APIs please refer: http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/ui/GameInput.html


GameInput APIs do not provide mapping between physical controls (for example, a button) and their logical counterparts (for example, DPAD right button or left trigger). There is a need for a higher level controls that makes common actions easier for the game developer. So, GameInput SWC is introduced and is designed such that it’s easier for the game developers to write games which use gamepads or such devices and minimum possible change is required to make an existing game work with a new input device.

You can download the GameInput SWC from https://www.dropbox.com/s/yfrsj8gdvcdg1bw/gameinputcontrolname.swc

For more details on GameInput SWC please refer: https://www.dropbox.com/s/wf67l9t3kkack7z/GameInputControlNameASDoc.zip

-Nimit

Adobe AIR Team

This topic has been closed for replies.

2 replies

MJD1981
Inspiring
June 3, 2013

Has anybody successfully implemented this yet?

Despite including the SWC provided, I'm getting "Class flash.ui::GameInput could not be found" on AIR 3.8.

Was I naive to think I could test this on Windows? Although I don't yet own an OUYA, I was hoping to get some response from an Xbox controller.

zeh
Inspiring
July 3, 2013

Thanks for this, guys. Will GameInput be available for other profiles in the future? Especially desktop and iOS (now that iOS is adding gamepad support). The documentation doesn't even list this limitation (although the tutorial does).

@MJD1981: it's working well when testing from an OUYA. When testing on a PC, it wouldn't work (GameInput.isSupported is false), but it should definitely be available as a class. The error you're seeing indicates it's not being imported at all. You're probably using the wrong airglobal.swc. I know it sounds crazy, but 3.8 is a beta, so not sure it actually contains all changes that have been applied to 3.7. Have you tried with the stable Air SDK?

MJD1981
Inspiring
July 4, 2013

I did manage to get it to work in the end, thanks - even at the desktop! Turns out I was calling the imports a little bit too late in my large project, so I made it more of a priority.

Inspiring
April 8, 2013

Just curious, will you release the SWC source code?

Thanks for you work.