Read joystick from Flash

Tag: flash Author: k5981462 Date: 2009-08-09

Can I read a joystick as input to a Flash applet? What options do I have?

Ideally I want something portable between MacOSX and Windows, but something Windows specific is acceptable. (Is Linux too much to hope for?) I'm also hoping for analog(ish) support; that is I might be told that the joystick is 62% up and 32% left, not just "Up" or "Up and Left".

I'd prefer something that doesn't require anything beyond the basic Adobe Flash plugin, but I should have the ability to install additional software.

Searching, all I'm finding are various packages that read the joystick interface and feed keystrokes into Flash. These seem crude, don't support analog input, potentially add lag (this is for a game, so responsiveness matters), and potentially fragile (I can probably control the hardware and operating system that it runs on, but would prefer flexibility in case of last minute surprises).

Best Answer

to put it in simple, and crushing words: flash cannot access joystick input

you should consider options pointed out by Branden, or some software, that'll convert joystick input to keyboard/mouse input ... other than that, there is this little library on bytearray.org ...

Other Answer1

The only real way to read actual joystick data is to use a SWF wrapper such as MDM Zinc. Their product does seem to support joysticks, but only on Windows (the product as a whole supports Windows/Mac/Linux).

Another SWF wrapper, SWFStudio, also has joystick support for Windows.