Skip to main content
January 21, 2013
Question

Using a USB joystick to input x y coordinates into flash

  • January 21, 2013
  • 1 reply
  • 796 views

Hi,

Is there any way to use a USB joystick to input X and Y coordinates into flash like a mouse? I have used joytokey but when the cursor leaves the stage the joystick has no effect on the game therefore I was hoping for some AS3 code that could do this for me, am I expecting too much?

The exe file of the below link works well but when I run the fla file in CS5 I get the error:

"file:///C|/Users/Chris/Downloads/joystick%20demo/Joystick%20Demo/Source/EngineVars.txt"

http://www.flashjester.com/?section=faq&cPath=14_66

Thanks


Chris

This topic has been closed for replies.

1 reply

leoserra
Inspiring
January 22, 2013

Hi Chris,

I never tried to use external devices (apart of a webcam) with Flash, but I remembered this project in Bytearray.org called FlashStick. Have you tried it?

Another thing is that it seems that the Flash stage looses focus of the mouse if it gets out of the stage in a webpage, unless you use some sort of Javascript to send the position. But I might be wrong and someone else enlights you better on this issue.

At least that's the behaviour I usually see on a Flash application in a webpage. When the mouse is out, Flash looses focus on it.

As for the error, that file (EngineVars.txt) is beeing called on the code, but it's not there.

I never used Jugglor but it seems that this would receive the joystick position and send it to Flash. See the documentation about this file with the variables.

Hope it helped.

Leonel