Packagekm.components
Classpublic class Knob
InheritanceKnob Inheritance UIComponent Inheritance flash.display.Sprite

The Knob component class.



Public Properties
 PropertyDefined by
 Inheritedduotone : Array
The duotone property can be used to convert the colors of the component into duotone.
UIComponent
 Inheritedenabled : Boolean
Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent.
UIComponent
  onChange : Function
onChange handler.
Knob
  rotationRange : int
Gets or sets the range the knob can be rotated.
The value can be between 0 and 360 but is ignored when the 'stops' array is set.
Knob
  scale : Number
[write-only] Sets the scale of the knob component.
The value can be between 0 and 1.
Knob
  stopColor : uint
[write-only] An ARGB color that can be set to draw little dots indicating where the stops are.
Knob
  stops : Array
[write-only] Sets an array of stops.
Stops are fixed points where the knob can be set to.
Knob
 InheritedtoolTip : String
Text to use as toolTip when ToolTip is enabled.
UIComponent
  value : Number
Gets or sets value of the knob.
If no stops are set, the value range is between 0 and 1.
If stops are set, the value is an array index of the stops array.
Knob
 Inheritedx : Number
UIComponent
 Inheritedy : Number
UIComponent
Public Methods
 MethodDefined by
  
Knob()
Knob
 Inherited
clone():*
Returns a clone of the component.
The skin of the component is cloned but other things like the text of a label or the items of a list aren't.
UIComponent
 Inherited
move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void
Moves the component to the specified coordinates.
UIComponent
 Inherited
setProperties(o:Object):void
Sets a number of properties at once.
UIComponent
  
setSkin(assetName:String, usePrefix:Boolean = true):void
Sets the skin asset.
Knob
Events
 EventSummaryDefined by
 Inherited The animationComplete event is broadcasted when an animated move is completed.UIComponent
   The change event is broadcasted when the knob is rotated.
It's also possible to use the onChange handler.
Knob
Property detail
onChangeproperty
public var onChange:Function

onChange handler.

rotationRangeproperty 
rotationRange:int  [read-write]

Gets or sets the range the knob can be rotated.
The value can be between 0 and 360 but is ignored when the 'stops' array is set.

The default value is 270.

Implementation
    public function get rotationRange():int
    public function set rotationRange(value:int):void
scaleproperty 
scale:Number  [write-only]

Sets the scale of the knob component.
The value can be between 0 and 1.

The default value is 1.

Implementation
    public function set scale(value:Number):void
stopColorproperty 
stopColor:uint  [write-only]

An ARGB color that can be set to draw little dots indicating where the stops are.

Implementation
    public function set stopColor(value:uint):void
stopsproperty 
stops:Array  [write-only]

Sets an array of stops.
Stops are fixed points where the knob can be set to. Each stop has to be a value between 0 and 360 degrees.
When stops are set, the value property is set to 0 making the knob point to the first stop.

Implementation
    public function set stops(value:Array):void
valueproperty 
value:Number  [read-write]

Gets or sets value of the knob.
If no stops are set, the value range is between 0 and 1.
If stops are set, the value is an array index of the stops array.

Implementation
    public function get value():Number
    public function set value(value:Number):void
Constructor detail
Knob()constructor
public function Knob()
Method detail
setSkin()method
public function setSkin(assetName:String, usePrefix:Boolean = true):void

Sets the skin asset. It works the same as for the Image class. The difference is that the bitmap image to use has to be composed of three square shaped sub images. This means the height of the skin image should be three times its width.
The sub images are from top to bottom the top layer, the mid layer that is rotating and the bottom layer.

Parameters
assetName:String
 
usePrefix:Boolean (default = true)

See also

km.core.Image.setSkin()
Event detail
changeevent 
Event object type: flash.events.Event

The change event is broadcasted when the knob is rotated.
It's also possible to use the onChange handler.