ActionScript Reference

com.bjc.ccs1

class BJCWheel

mx.core.UIComponent
  |
  +--com.bjc.ccs1.BJCWheel



class BJCWheel
extends UIComponent

The BJC Wheel is a control component that allows users to adjust analog or digital values. The Digital mode calls the user defined callback function when the wheel button is released. The Analog mode calls the callback function while dragging the wheel button.

Usage:
myBJCWheel.setCallback( "myCallback" ); // Set the function to call on wheel dragging
 
function myCallback( value )
{
	trace( "VALUE: " + value ); // This code will run when the wheel is dragged
}


Author:
Flashloaded - www.flashloaded.com

Version:
1.5.0


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 wheel is dragged.

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
Maximum: Number (write-only)
This property may be used to set the maximum value of the wheel.

public
Minimum: Number (write-only)
This property may be used to set the minimum value of the wheel.

public
Mode: String (write-only)
This property may be used to set the wheel mode.

public
Separators: Number (write-only)
This property may be used to set amount of separators.

public
StartingValue: Number (write-only)
This property may be used to set the starting value of the wheel.

public
Steps: Number (write-only)
This property may be used to set the amount of snap points.

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 field.

Constructor


BJCWheel ( )
Constructor

Method Summary


doLayout ( ): Void


public
getValue ( ): Number
This method may be used to get the current value of the wheel.

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 wheel is dragged.

public
setMode ( mode: String ): Void
This method may be used to set the mode of the wheel.

public
setScale ( min: Number, max: Number, step: Number ): Void
This method may be used to set the value range and step amount.

public
setSeparators ( amount: Number ): Void
This method may be used to set amount of separators in the wheel.

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
setValue ( value: Number ): Void
This method may be used to set the value of the wheel.

public
viewValue ( view: Boolean, font: String, color: Number ): Void
This method may be used to set the visibility of the value field.



Property Documentation

BgColor

public BgColor: Number (write-only)
This property may be used to set the background color.

CallBackFunction

public CallBackFunction: String (write-only)
This property may be used to set the function to be called when the wheel is dragged.

Font

public Font: String (write-only)
This property may be used to set the text font.

FontColor

public FontColor: Number (write-only)
This property may be used to set the font color.

Maximum

public Maximum: Number (write-only)
This property may be used to set the maximum value of the wheel.

Minimum

public Minimum: Number (write-only)
This property may be used to set the minimum value of the wheel.

Mode

public Mode: String (write-only)
This property may be used to set the wheel mode.

Separators

public Separators: Number (write-only)
This property may be used to set amount of separators.

StartingValue

public StartingValue: Number (write-only)
This property may be used to set the starting value of the wheel.

Steps

public Steps: Number (write-only)
This property may be used to set the amount of snap points.

Title

public Title: String (write-only)
This property may be used to set the title.

TitleVisible

public TitleVisible: String (write-only)
This property may be used to hide or show the title field.

ValueVisible

public ValueVisible: String (write-only)
This property may be used to hide or show the value field.


Constructor Documentation

BJCWheel

function BJCWheel()
Constructor


Method Documentation

doLayout

function doLayout(): Void

getValue

public function getValue(): Number
This method may be used to get the current value of the wheel.

Usage:
myVar = myBJCWheel.getValue();

Returns:
The current value of the wheel.

setBgColor

public function setBgColor(col: Number): Void
This method may be used to set the background color of the component.

Usage:
myBJCWheel.setBgColor( 0xff0000 );

Parameters:
col
A color value that indicates the background color of the component.
Returns:
Nothing.

setCallback

public function setCallback(cb: String): Void
This method may be used to set the function to be called when the wheel is dragged.

This method may be used to set the function to be called when the wheel 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.

Usage:
myBJCWheel.setCallback( "_root.cbFunc" );

Parameters:
cb
The function to be called when the wheel is dragged.
Returns:
Nothing.

setMode

public function setMode(mode: String): Void
This method may be used to set the mode of the wheel.

This method may be used to set mode of the wheel. The analog mode allows the wheel to execute it's callback function continuously during the scroll. The digital mode allows the wheel to execute it's callback function only when scrolling has ended.

Usage:
myBJCWheel.setMode( "Digital" );

Parameters:
mode
The mode of the component. Can be set to 'Digital' or 'Analog'.
Returns:
Nothing.

setScale

public function setScale(min: Number,
max: Number,
step: Number): Void
This method may be used to set the value range and step amount.

This method may be used to set the minimum value, maximum value and the number of steps of the wheel. If the number of steps is bigger than 0, the wheel will snap itself to the nearest step point available. The maximum amount of steps is the value range between the maximum and minimum values.

Usage:
myBJCWheel.setScale( 0, 100, 5 );

Parameters:
min
The minimum value of the wheel.
max
The maximum value of the wheel.
step
The amount of steps the wheel will snap to.
Returns:
Nothing.

setSeparators

public function setSeparators(amount: Number): Void
This method may be used to set amount of separators in the wheel.

Usage:
myBJCWheel.setSeparators( 5 );

Parameters:
amount
The amount of the separators to be set.
Returns:
Nothing.

setTitle

public function 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.

Usage:
myBJCWheel.setTitle( true, "Arial", 0xff0000, "RPM" );

Parameters:
view
A boolean value that indicates the visibility of the title field.
font
The font name that will be used in the component. May be set to null to disable this change.
color
A color value that indicates the font color of the component. May be set to null to disable this change.
text
A string value that indicates the title. May be set to null to disable this change.
Returns:
Nothing.

setValue

public function setValue(value: Number): Void
This method may be used to set the value of the wheel.

Usage:
myBJCWheel.setValue( 100 );

Parameters:
value
The wheel will be set to the given value.
Returns:
Nothing.

viewValue

public function viewValue(view: Boolean,
font: String,
color: Number): Void
This method may be used to set the visibility of the value field.

Usage:
myBJCWheel.viewValue( false, null, null );

Parameters:
view
A boolean value that indicates the visibility of the value field.
font
The font name that will be used in the component. May be set to null to disable this change.
color
A color value that indicates the font color of the component. May be set to null to disable this change.
Returns:
Nothing.