FlashJoystick.swc is located in the FlashComponent directory. It is not required to use the joystick, but is required when developing to add rumble functionality to your Flash CS3 applications. At this time the component is only
built for Flash CS3. Support for older versions of Flash will be added as time goes on. To install the Flash CS3 component included with the install, copy FlashJoystick.swc from DirectoryYouInstalledFlashJoystick/FlashComponent/ and in XP move it to:
For Vista move it to:
Once you have copied the swc file to the components directory, restart Flash and look in the components tab. You should see FlashJoystick Utils v1.0 under Standard Components in the Components tab.
Due to Flash security policies, when testing on a local machine, you will get this error:
This problem is fixed by hitting the settings button, and adding the directory where your flash movie is into into the
Global Security Settings tab. You will have to take out any %20's out of the path as
the Flash Player settings does not recoginze the %20 as a space. This isn't an issue online. Players of games online using FlashJoystick Utils will not have to do anything to get this to work. This is a
local security setting.
To use the component in your Flash application, simply move the component to the stage. Once it is on the stage, give the newly dragged component an instance name.
Once you have given the component an instance name, it is ready to use. As it stands right now, FlashJoystick Utils only has one function, Rumble. Rumble allows a developer to send a vibration message to
a specific controller. Below is the function definition in the component:
public function Rumble(playerIndex:int, leftMotorSpeed:int, rightMotorSpeed:int):void
In the example below, joystick one will rumble at 100% power on the left and right motor.
joyUtil.Rumble(1,100,100);
This will rumble at full power until the developer sends another message to turn off the rumble on that joystick. This can be done like this:
joyUtil.Rumble(1,0,0);
At this time, there is only mapping support for one joystick. This will be updated in the next release to allow mapping for up to 4 controllers.