Packageardisia.components.sliderField
Classpublic class SliderField
InheritanceSliderField Inheritance spark.components.supportClasses.SkinnableComponent
Implements mx.managers.IFocusManagerComponent

Numerical field that combines a text input (restricted to numbers only) with a vertical slider. The vertical slider thumb is centered beneath the mouse for efficient adjustments.

User can open the slider via a MOUSE_DOWN event on the open button. If the user adjusts the slider while holding down the same MOUSE_DOWN as the initial MOUSE_DOWN used to open the slider, the value will be committed and the slider will be closed. Otherwise, the slider is closed closed from mouse events or the ESC or ENTER key are depressed.

A value of NaN means the user entered a blank value.

Handles focus, keyboard, and mouse interaction.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  isSliderOpen : Boolean
[read-only] True if the slider is currently displayed.
SliderField
  maximum : Number
The maximum allowable value.
SliderField
  minimum : Number
The minimum allowable value.
SliderField
  snapInterval : Number
The snapInterval for the "value" property.
SliderField
  value : Number
The commited numerical value.
SliderField
Protected Methods
 MethodDefined By
  
closeSlider(commit:Boolean = true):void
Hides the slider and dispatches the "close" event.
SliderField
  
commitValue(proposedValue:Number, dispatchChange:Boolean = false):void
Commits the value and dispatches the "change" event.
SliderField
  
eventHandler(event:Event):void
Handles events for the control.
SliderField
  
openButtonPartHandler(event:Event):void
Handles events on the openButtonPart.
SliderField
  
openSlider(event:MouseEvent):void
Creates and displays the slider and dispatches the "open" event.
SliderField
  
sliderFactoryPartHandler(event:Event):void
Handles events on the sliderFactoryPart.
SliderField
  
textInputPartHandler(event:Event):void
Handles events on the textInputPart.
SliderField
  
Update the text input skin part.
SliderField
Events
 Event Summary Defined By
  Dispatched when the "value" property changes due to user interaction.SliderField
  Dispatched when the slider is closed (hidden).SliderField
  Dispatched when the slider is opened (displayed).SliderField
  Dispatched when the "value" property changes.SliderField
Styles
 Style Description Defined By
  
paddingBottom
Type: Number Format: Length CSS Inheritance: no
Bottom padding for the text field. The default value is 3.
SliderField
  
paddingLeft
Type: Number Format: Length CSS Inheritance: no
Left padding for the text field. The default value is 3.
SliderField
  
paddingRight
Type: Number Format: Length CSS Inheritance: no
Right padding for the text field. The default value is 3.
SliderField
  
paddingTop
Type: Number Format: Length CSS Inheritance: no
Top padding for the text field. The default value is 5.
SliderField
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
openButtonPart:spark.components.supportClasses.ButtonBase
Required: true Part Type: Static
The button that pops up the slider.
SliderField
  
sliderFactoryPart:mx.core.IFactory
Required: true Part Type: Static
The vertical slider used to change the underlying value.
SliderField
  
textInputPart:spark.components.TextInput
Required: true Part Type: Static
TextInput that allows the user to directly change the value via keyboard interaction.
SliderField
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
  
disabled
SliderField
  
normal
SliderField
  
open
Skin state when the slider is visible. SliderField
Property Detail
isSliderOpenproperty
isSliderOpen:Boolean  [read-only]

True if the slider is currently displayed.

The default value is false.


Implementation
    public function get isSliderOpen():Boolean
maximumproperty 
maximum:Number

The maximum allowable value.

The default value is 100.


Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimumproperty 
minimum:Number

The minimum allowable value.

The default value is 0.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
snapIntervalproperty 
snapInterval:Number

The snapInterval for the "value" property.

The default value is 1.


Implementation
    public function get snapInterval():Number
    public function set snapInterval(value:Number):void
valueproperty 
value:Number

The commited numerical value. Can be set to NaN.

This property is bindable and bound to "valueCommit" events.

The default value is 0.

This property can be used as the source for data binding.


Implementation
    public function get value():Number
    public function set value(value:Number):void
Method Detail
closeSlider()method
protected function closeSlider(commit:Boolean = true):void

Hides the slider and dispatches the "close" event.

Parameters

commit:Boolean (default = true) — true to commit the new value

commitValue()method 
protected function commitValue(proposedValue:Number, dispatchChange:Boolean = false):void

Commits the value and dispatches the "change" event. Will bound the value to the minimum and maximum values and apply the snapInterval.

Parameters

proposedValue:Number — Number
 
dispatchChange:Boolean (default = false) — Boolean true to dispatch a "change" event to signify the update is due to user interaction

eventHandler()method 
protected function eventHandler(event:Event):void

Handles events for the control.

Parameters

event:Event — the Event that triggered the handler

openButtonPartHandler()method 
protected function openButtonPartHandler(event:Event):void

Handles events on the openButtonPart.

Parameters

event:Event — the Event that triggered the handler

openSlider()method 
protected function openSlider(event:MouseEvent):void

Creates and displays the slider and dispatches the "open" event.

Parameters

event:MouseEvent

sliderFactoryPartHandler()method 
protected function sliderFactoryPartHandler(event:Event):void

Handles events on the sliderFactoryPart.

Parameters

event:Event — the Event that triggered the handler

textInputPartHandler()method 
protected function textInputPartHandler(event:Event):void

Handles events on the textInputPart.

Parameters

event:Event — the Event that triggered the handler

updateTextInputPart()method 
protected function updateTextInputPart():void

Update the text input skin part.

Event Detail
change Event
Event Object Type: ardisia.components.sliderField.events.SliderFieldEvent
SliderFieldEvent.type property = ardisia.components.sliderField.events.SliderFieldEvent

Dispatched when the "value" property changes due to user interaction.

close Event  
Event Object Type: ardisia.components.sliderField.events.SliderFieldEvent
SliderFieldEvent.type property = ardisia.components.sliderField.events.SliderFieldEvent

Dispatched when the slider is closed (hidden).

open Event  
Event Object Type: ardisia.components.sliderField.events.SliderFieldEvent
SliderFieldEvent.type property = ardisia.components.sliderField.events.SliderFieldEvent

Dispatched when the slider is opened (displayed).

valueCommit Event  
Event Object Type: mx.events.FlexEvent
FlexEvent.type property = mx.events.FlexEvent

Dispatched when the "value" property changes.