KoolMoves AS3 API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class Knob

Package | km.components
Class | public class Knob
Inheritance | Knob UIComponent flash.display.Sprite

The Knob component class.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | duotone : Array The duotone property can be used to convert the colors of the component into duotone. | UIComponent
|  | enabled : 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
|  | toolTip : 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
|  | x : Number | UIComponent
|  | y : Number | UIComponent

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | Knob() | Knob
|  | 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
|  | move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void Moves the component to the specified coordinates. | UIComponent
|  | 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
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined by
--- | --- | --- | ---
|  | animationComplete | The animationComplete event is broadcasted when an animated move is completed. | UIComponent
|  | change | The change event is broadcasted when the knob is rotated. It's also possible to use the onChange handler. | Knob

Property detail

onChange | property

`public var onChange:Function`

onChange handler.

rotationRange | property |

`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`

scale | property |

`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`

stopColor | property |

`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`

stops | property |

`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`

value | property |

`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

change | event

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.

Last update : 04/05/2008