next up previous contents
Next: Events Up: Methods Previous: read   Contents

buttonState

Description
Gets the state of the specified button. You should call the "read" method before get the state of a button.


Syntax

joystick.buttonState(index)


Parameters

index
Integer. Specifies the index of the button. The index of the first button is 0.


Returns

Boolean. If the button is pressed, returns true.


Example

function readJoystick()
{
    joy[0].read();
    trace(joy[0].buttonState[0]);
}

Application.setInterval(readJoystick, 50);




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.