gamepadLayout contains a flash MovieClip with an xbox360 controller graphic with buttons and sticks that can align.

new GamepadLayoutGraphic() creates the movieclip to be added to the display list.

here is the basic code to update its visuals :

(not that the sticks have a red arrow graphic (RIGHT/LEFT_STICK_POINTER) which can be rotated (in degrees) to show the stick direction)
alpha of the buttons can be mapped to the value of the buttons as well to see the changes in values for analog buttons.

var gamePad:Gamepad = GamePadManager.getInstance().getGamePadByChannel(0);

			if (!gamePad)

{

gamepadlayout.alpha = 0;

return;

}

gamepadlayout.alpha = 0.7;

gamepadlayout.L1.alpha = gamePad.getButton(GamePadMap.L1).value;

gamepadlayout.R1.alpha = gamePad.getButton(GamePadMap.R1).value;

gamepadlayout.L2.alpha = gamePad.getButton(GamePadMap.L2).value;

gamepadlayout.R2.alpha = gamePad.getButton(GamePadMap.R2).value;

gamepadlayout.L3.alpha = gamePad.getButton(GamePadMap.L3).value;

gamepadlayout.R3.alpha = gamePad.getButton(GamePadMap.R3).value;

gamepadlayout.SELECT.alpha = gamePad.getButton(GamePadMap.SELECT).value;

gamepadlayout.START.alpha = gamePad.getButton(GamePadMap.START).value;

gamepadlayout.BUTTON_TOP.alpha = gamePad.getButton(GamePadMap.BUTTON_TOP).value;

gamepadlayout.BUTTON_BOTTOM.alpha = gamePad.getButton(GamePadMap.BUTTON_BOTTOM).value;

gamepadlayout.BUTTON_LEFT.alpha = gamePad.getButton(GamePadMap.BUTTON_LEFT).value;

gamepadlayout.BUTTON_RIGHT.alpha = gamePad.getButton(GamePadMap.BUTTON_RIGHT).value;

gamepadlayout.DPAD_UP.alpha = gamePad.getButton(GamePadMap.DPAD_UP).value;

gamepadlayout.DPAD_DOWN.alpha = gamePad.getButton(GamePadMap.DPAD_DOWN).value;

gamepadlayout.DPAD_LEFT.alpha = gamePad.getButton(GamePadMap.DPAD_LEFT).value;

gamepadlayout.DPAD_RIGHT.alpha = gamePad.getButton(GamePadMap.DPAD_RIGHT).value;

gamepadlayout.LEFT_STICK_POINTER.alpha = gamePad.getStick(GamePadMap.STICK_LEFT).length;

gamepadlayout.LEFT_STICK_POINTER.rotation = gamePad.getStick(GamePadMap.STICK_LEFT).angle * 180 / Math.PI + 90;

gamepadlayout.RIGHT_STICK_POINTER.alpha = gamePad.getStick(GamePadMap.STICK_RIGHT).length;

gamepadlayout.RIGHT_STICK_POINTER.rotation = gamePad.getStick(GamePadMap.STICK_RIGHT).angle * 180 / Math.PI + 90;
Merge remote-tracking branch 'origin/master'