Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class Knob

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.controls.Knob


class Knob
extends BJCComponent

A rotary knob for setting values

Events:

change - Fired whenever the user moves the mouse after pressing on the knob, changing the current value.
focus - Fired whenever the component receives focus.
killFocus - Fired whenever the component loses focus.
tabFocus - Fired whenever the component receives focus by pressing the TAB key.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

public
changeHandler: Function
Can be used to assign a direct event handler to the component instance.

public
eventOnValue: Boolean
Can be used to choose whetever the event handler will be called when the value has been set by code. This variable is set to true by default.

public
focusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

public
tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
maximum: Number (write)
Sets the maximum possible value on the knob. Note, it is possible to make a "backwards" knob by making maximum lower than minimum.

public
maximum: Number (read)
Gets the maximum possible value on the knob.

public
minimum: Number (write)
Sets the minimum possible value on the knob. Note, it is possible to make a "backwards" knob by making maximum lower than minimum.

public
minimum: Number (read)
Gets the minimum possible value on the knob.

public
mode: String (write)
Determines what type of mouse movement will be used to change the knob's value. Vertical means that after clicking on the knob, dragging up will increase its value, dragging down will decrease it. For horizontal, dragging right and left will increase or decrease the value, respectively. In the angular mode the knob value will be set by the mouse position (added in version 1.2).

public
mode: String (read)
Gets the mode the knob.

public
sensitivity: Number (write)
Determines how much mouse movement is needed to make a given amount of change of value in the knob. A higher value for sensitivity will mean that less mouse movement is required to cycle through the full range of values.

public
sensitivity: Number (read)
Gets the the knob sensitivity.

public
value: Number (write)
Sets the value of the knob. This will fire the change event if the eventOnValue is set to true (changed in version 1.3).

public
value: Number (read)
Gets the value of the knob.

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
Knob ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): Knob
Static method used to create an instance of a Knob on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

changeHandler

public var changeHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myKnob.changeHandler = function(){
trace("I was changed.");
}

eventOnValue

public var eventOnValue: Boolean
Can be used to choose whetever the event handler will be called when the value has been set by code. This variable is set to true by default.

Usage:
myKnob.eventOnValue = false;
myKnob.value = 0xFF0000;

focusHandler

public var focusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myKnob.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

public var killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myKnob.killFocusHandler = function(){
trace("Kill focus.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help

tabFocusHandler

public var tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myKnob.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

maximum

public maximum: Number (write)
Sets the maximum possible value on the knob. Note, it is possible to make a "backwards" knob by making maximum lower than minimum.

Example:
myKnob.maximum = 100;

maximum

public maximum: Number (read)
Gets the maximum possible value on the knob.

Example:
myVar = myKnob.maximum;

minimum

public minimum: Number (write)
Sets the minimum possible value on the knob. Note, it is possible to make a "backwards" knob by making maximum lower than minimum.

Example:
myKnob.minimum = 0;

minimum

public minimum: Number (read)
Gets the minimum possible value on the knob.

Example:
myVar = myKnob.minimum;

mode

public mode: String (write)
Determines what type of mouse movement will be used to change the knob's value. Vertical means that after clicking on the knob, dragging up will increase its value, dragging down will decrease it. For horizontal, dragging right and left will increase or decrease the value, respectively. In the angular mode the knob value will be set by the mouse position (added in version 1.2).

Example:
myKnob.mode = "vertical";

mode

public mode: String (read)
Gets the mode the knob.

Example:
myVar = myKnob.mode;

sensitivity

public sensitivity: Number (write)
Determines how much mouse movement is needed to make a given amount of change of value in the knob. A higher value for sensitivity will mean that less mouse movement is required to cycle through the full range of values.

Example:
myKnob.sensitivity = 10;

sensitivity

public sensitivity: Number (read)
Gets the the knob sensitivity.

Example:
myVar = myKnob.sensitivity;

value

public value: Number (write)
Sets the value of the knob. This will fire the change event if the eventOnValue is set to true (changed in version 1.3).

Example:
myKnob.value = 50;

value

public value: Number (read)
Gets the value of the knob.

Example:
myVar = myKnob.value;


Constructor Documentation

Knob

public function Knob(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): Knob
Static method used to create an instance of a Knob on stage at run time.

Parameters:
target
the movie clip to which the knob will be attached.
id
the instance name given to the new knob attached.
depth
the depth at which to attach the new knob.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new knob attached.

Example:
import com.bjc.controls.Knob;
var newKnob:Knob = Knob.create(_root, "myKnob", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com