ActionScript Reference
com.bjc.ccs1
mx.core.UIComponent | +--com.bjc.ccs1.BJCSwitch
myBJCSwitch.setCallback( "myCallback" ); // Set the function to call on state change
function myCallback( value )
{
if( value == 1 )
{
trace( "SWITCH UP" ); // This code will run on up state
}
else if( value == 2 )
{
trace( "SWITCH MIDDLE" ); // This code will run on middle state
}
else if( value == 3 )
{
trace( "SWITCH DOWN" ); // This code will run on down state
}
}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 switch state has changed. | |
| public | Mode: String (write-only) |
| This property may be used to set the switch mode. | |
| public | Start: String (write-only) |
| This property may be used to set the state on start. | |
| public | TitleColor: Number (write-only) |
| This property may be used to set the font color. | |
| public | TitleDown: String (write-only) |
| This property may be used to set the title of the down state. | |
| public | TitleFont: String (write-only) |
| This property may be used to set the text font. | |
| public | TitleMiddle: String (write-only) |
| This property may be used to set the title of the middle state. | |
| public | TitlesVisible: String (write-only) |
| This property may be used to set the title visibility. | |
| public | TitleUp: String (write-only) |
| This property may be used to set the title of the up state. | |
Constructor | |
| BJCSwitch ( ) | |
| Constructor | |
Method Summary | |
| public | getValue ( ): Number |
| This method may be used to get the current state value of the switch. | |
| public | setBgColor ( col: Number ): Void |
| This method may be used to set the background color of the switch. | |
| public | setCallback ( cb: String ): Void |
| This method may be used to set the function to be called when the switch state has changed. | |
| public | setDown ( ): Void |
| This method may be used to set the switch state to 'Down'. | |
| public | setMiddle ( ): Void |
| This method may be used to set the switch state to 'Middle'. | |
| public | setMode ( mod: String ): Void |
| This method may be used to set mode of the switch. | |
| public | setTitles ( view: Boolean, font: String, color: Number, text1: String, text2: String, text3: String ): Void |
| This method may be used to set the visibility of the title field and changes the title texts. | |
| public | setUp ( ): Void |
| This method may be used to set the switch state to 'Up'. | |
|
| This property may be used to set the background color. |
|
| This property may be used to set the function to be called when the switch state has changed. |
|
| This property may be used to set the switch mode. |
|
| This property may be used to set the state on start. |
|
| This property may be used to set the font color. |
|
| This property may be used to set the title of the down state. |
|
| This property may be used to set the text font. |
|
| This property may be used to set the title of the middle state. |
|
| This property may be used to set the title visibility. |
|
| This property may be used to set the title of the up state. |
|
| Constructor |
|
This method may be used to get the current state value of the switch.
|
|
|
This method may be used to set the background color of the switch.
| |||
|
|
| This method may be used to set the function to be called when the switch state has changed. This method may be used to set the function to be called when the switch state has changed. 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 switch state to 'Down'.
|
|
|
This method may be used to set the switch state to 'Middle'.
|
|
|
| This method may be used to set mode of the switch. This method may be used to set mode of the switch. The On/Off mode has two states: 'Up' and 'Down'. The Regular mode has also a 'Middle' state.
| |||
|
|
This method may be used to set the visibility of the title field and changes the title texts.
| ||||||||||||||||||
|
|
This method may be used to set the switch state to 'Up'.
|
|