ActionScript Reference
com.bjc.ccs1
mx.core.UIComponent | +--com.bjc.ccs1.BJCJoystick
myBJCJoystick.setCallback( "myCallback" ); // Set the function to call on knob dragging
function myCallback( value1, value2 )
{
trace( "VALUE1: " + value1 + "VALUE2: " + value2 );
// This code will run when the joystick knob is dragged
} Property Summary | |
| public | BgColor: Number (write-only) |
| This property may be used to set the background color. | |
| public | CallBackFunction: String (write-only) |
| This property may be used to set the function to be called when the joystick is moved. | |
| public | Font: String (write-only) |
| This property may be used to set the text font. | |
| public | FontColor: Number (write-only) |
| This property may be used to set the font color. | |
| public | Mode: String (write-only) |
| This property may be used to set the value mode. | |
| public | Title: String (write-only) |
| This property may be used to set the title. | |
| public | TitleVisible: String (write-only) |
| This property may be used to hide or show the title field. | |
| public | ValueVisible: String (write-only) |
| This property may be used to hide or show the value fields. | |
Constructor | |
| BJCJoystick ( ) | |
| Constructor | |
Method Summary | |
| public | getAngle ( ): Number |
| This method may be used to get the current direction angle of the joystick knob from center point. | |
| public | getDistance ( ): Number |
| This method may be used to get the current distance of the joystick knob from center point. | |
| public | getXValue ( ): Number |
| This method may be used to get the current X position of the joystick knob. | |
| public | getYValue ( ): Number |
| This method may be used to get the current Y position of the joystick knob. | |
| public | setBgColor ( col: Number ): Void |
| This method may be used to set the background color of the component. | |
| public | setCallback ( cb: String ): Void |
| This method may be used to set the function to be called when the joystick knob is dragged. | |
| public | setMode ( mod: String ): Void |
| This method may be used to set the value mode of the joystick. | |
| public | setTitle ( view: Boolean, font: String, color: Number, text: String ): Void |
| This method may be used to set the visibility of the title field and changes the title text. | |
| public | viewValues ( view: Boolean, font: String, color: Number ): Void |
| This method may be used to set the visibility of the value fields. | |
|
| This property may be used to set the background color. |
|
| This property may be used to set the function to be called when the joystick is moved. |
|
| This property may be used to set the text font. |
|
| This property may be used to set the font color. |
|
| This property may be used to set the value mode. |
|
| This property may be used to set the title. |
|
| This property may be used to hide or show the title field. |
|
| This property may be used to hide or show the value fields. |
|
| Constructor |
|
This method may be used to get the current direction angle of the joystick knob from center point.
|
|
|
This method may be used to get the current distance of the joystick knob from center point.
|
|
|
This method may be used to get the current X position of the joystick knob.
|
|
|
This method may be used to get the current Y position of the joystick knob.
|
|
|
This method may be used to set the background color of the component.
| |||
|
|
| This method may be used to set the function to be called when the joystick knob is dragged. This method may be used to set the function to be called when the joystick knob is dragged. The called function must be in the same timeline as the component or the path to the function must be specified as well.
| |||
|
|
| This method may be used to set the value mode of the joystick. This method may be used to set mode of the joystick. The 'X/Y' mode will send values from -100 to 100 as the X-positon value and values from -100 to 100 as the Y-positon value to the callback function. The 'Angle/Distance' mode will send values from 0 to 360 as the angle value and values from 0 to 100 as distance value to the callback function.
| |||
|
|
This method may be used to set the visibility of the title field and changes the title text.
| ||||||||||||
|
|
This method may be used to set the visibility of the value fields.
| |||||||||
|