Input.Joystick.enable() This page was last modified over 30 day(s) ago and has 0 comment(s)


Back to Input.Joystick Class Summary

Availability
Windows

Usage
mdm.Input.Joystick.enable(joystickID:Number, joystickEmulationType:String):Void

Parameters
joystickID:Number - Joystick identifier

emulationType:String - Emulation type

Returns
Nothing

Description
Enables Joystick control in current Form. The parameter joystickID is either "1" or "2" for the corresponding Joystick. The 'emulationType' parameter is either "keyboard" or "mouse". If emulationType is set to "mouse", the mouse cursor will respond to the Joystick position and the following Joystick buttons are assigned to the following actions:

Fire Button 1 - simulates LEFT mouse click
Fire Button 2 - simulates SPACE key pressed
Fire Button 3 - simulates 'a' key pressed
Fire Button 4 - simulates 's' key pressed

Notes
The joystick is only compatible with standard Forms. Transparent forms can not use the Joystick.

When Keyboard emulation is enabled, the following variables are created in your Flash Movie:

mdm_joystick1_xlevel (Contains the current X level of Joystick 1 from -100 to 100)
mdm_joystick1_ylevel (Contains the current Y level of Joystick 1 from -100 to 100)
mdm_joystick2_xlevel (Contains the current X level of Joystick 2 from -100 to 100)
mdm_joystick2_ylevel (Contains the current Y level of Joystick 2 from -100 to 100)

Example Code
mdm.Input.Joystick.enable(1, "mouse");

mdm.Input.Joystick Class Example Downloads
No Example Downloads Available


Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page