Package com.bit101.components
Class public class RangeSlider
Inheritance RangeSlider InheritanceComponent Inheritance flash.display.Sprite
Subclasses HRangeSlider, VRangeSlider



Public Properties
  Property Defined By
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    highValue : Number
Gets / sets the high value for this slider.
RangeSlider
    labelMode : String
Sets / gets when the labels will appear.
RangeSlider
    labelPosition : String
Sets / gets where the labels will appear.
RangeSlider
    labelPrecision : int
Sets / gets how many decimal points of precisions will be displayed on the labels.
RangeSlider
    lowValue : Number
Gets / sets the low value of this slider.
RangeSlider
    maximum : Number
Gets / sets the maximum value of the slider.
RangeSlider
    minimum : Number
Gets / sets the minimum value of the slider.
RangeSlider
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
    tick : Number
Gets / sets the tick value of this slider.
RangeSlider
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _back : Sprite
RangeSlider
  Inherited _enabled : Boolean = true
Component
  Inherited _height : Number = 0
Component
    _highLabel : Label
RangeSlider
    _highValue : Number = 100
RangeSlider
    _labelMode : String = always
RangeSlider
    _labelPosition : String
RangeSlider
    _labelPrecision : int = 0
RangeSlider
    _lowLabel : Label
RangeSlider
    _lowValue : Number = 0
RangeSlider
    _maxHandle : Sprite
RangeSlider
    _maximum : Number = 100
RangeSlider
    _minHandle : Sprite
RangeSlider
    _minimum : Number = 0
RangeSlider
    _orientation : String = vertical
RangeSlider
  Inherited Ronda : Class
Component
  Inherited _tag : int = -1
Component
    _tick : Number = 1
RangeSlider
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
RangeSlider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)
Constructor
RangeSlider
   
draw():void
[override] Draws the visual ui of the component.
RangeSlider
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
RangeSlider
   
drawBack():void
Draws the back of the slider.
RangeSlider
   
drawHandles():void
Draws the handles of the slider.
RangeSlider
   
getLabelForValue(value:Number):String
Generates a label string for the given value.
RangeSlider
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
RangeSlider
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onDragMax(event:MouseEvent):void
Internal mouseDown handler for the high value handle.
RangeSlider
   
onDragMin(event:MouseEvent):void
Internal mouseDown handler for the low value handle.
RangeSlider
   
onDrop(event:MouseEvent):void
Internal mouseUp handler.
RangeSlider
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
onMaxSlide(event:MouseEvent):void
Internal mouseMove handler for when the high value handle is being moved.
RangeSlider
   
onMinSlide(event:MouseEvent):void
Internal mouseMove handler for when the low value handle is being moved.
RangeSlider
   
Adjusts positions of handles when value, maximum or minimum have changed.
RangeSlider
   
updateLabels():void
Sets the text and positions the labels.
RangeSlider
Public Constants
  Constant Defined By
    ALWAYS : String = always
[static]
RangeSlider
    BOTTOM : String = bottom
[static]
RangeSlider
  Inherited DRAW : String = draw
[static]
Component
    HORIZONTAL : String = horizontal
[static]
RangeSlider
    LEFT : String = left
[static]
RangeSlider
    MOVE : String = move
[static]
RangeSlider
    NEVER : String = never
[static]
RangeSlider
    RIGHT : String = right
[static]
RangeSlider
    TOP : String = top
[static]
RangeSlider
    VERTICAL : String = vertical
[static]
RangeSlider
Property Detail
_back property
protected var _back:Sprite

_highLabel property  
protected var _highLabel:Label

_highValue property  
protected var _highValue:Number = 100

_labelMode property  
protected var _labelMode:String = always

_labelPosition property  
protected var _labelPosition:String

_labelPrecision property  
protected var _labelPrecision:int = 0

_lowLabel property  
protected var _lowLabel:Label

_lowValue property  
protected var _lowValue:Number = 0

_maxHandle property  
protected var _maxHandle:Sprite

_maximum property  
protected var _maximum:Number = 100

_minHandle property  
protected var _minHandle:Sprite

_minimum property  
protected var _minimum:Number = 0

_orientation property  
protected var _orientation:String = vertical

_tick property  
protected var _tick:Number = 1

highValue property  
highValue:Number

Gets / sets the high value for this slider.


Implementation
    public function get highValue():Number
    public function set highValue(value:Number):void
labelMode property  
labelMode:String

Sets / gets when the labels will appear. Can be "never", "move", or "always"


Implementation
    public function get labelMode():String
    public function set labelMode(value:String):void
labelPosition property  
labelPosition:String

Sets / gets where the labels will appear. "left" or "right" for vertical sliders, "top" or "bottom" for horizontal.


Implementation
    public function get labelPosition():String
    public function set labelPosition(value:String):void
labelPrecision property  
labelPrecision:int

Sets / gets how many decimal points of precisions will be displayed on the labels.


Implementation
    public function get labelPrecision():int
    public function set labelPrecision(value:int):void
lowValue property  
lowValue:Number

Gets / sets the low value of this slider.


Implementation
    public function get lowValue():Number
    public function set lowValue(value:Number):void
maximum property  
maximum:Number

Gets / sets the maximum value of the slider.


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

Gets / sets the minimum value of the slider.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
tick property  
tick:Number

Gets / sets the tick value of this slider. This round the value to the nearest multiple of this number.


Implementation
    public function get tick():Number
    public function set tick(value:Number):void
Constructor Detail
RangeSlider () Constructor
public function RangeSlider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)

Constructor

Parameters
orientation:String — Whether the slider will be horizontal or vertical.
 
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this Slider.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
defaultHandler:Function (default = null) — The event handling function to handle the default event for this component (change in this case).
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

draw () method  
override public function draw():void

Draws the visual ui of the component.

drawBack () method  
protected function drawBack():void

Draws the back of the slider.

drawHandles () method  
protected function drawHandles():void

Draws the handles of the slider.

getLabelForValue () method  
protected function getLabelForValue(value:Number):String

Generates a label string for the given value.

Parameters

value:Number — The number to create a label for.

Returns
String
init () method  
override protected function init():void

Initializes the component.

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

Internal mouseDown handler for the high value handle. Starts dragging the handle.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onDragMin () method  
protected function onDragMin(event:MouseEvent):void

Internal mouseDown handler for the low value handle. Starts dragging the handle.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onDrop () method  
protected function onDrop(event:MouseEvent):void

Internal mouseUp handler. Stops dragging the handle.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMaxSlide () method  
protected function onMaxSlide(event:MouseEvent):void

Internal mouseMove handler for when the high value handle is being moved.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMinSlide () method  
protected function onMinSlide(event:MouseEvent):void

Internal mouseMove handler for when the low value handle is being moved.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
positionHandles () method  
protected function positionHandles():void

Adjusts positions of handles when value, maximum or minimum have changed. TODO: Should also be called when slider is resized.

updateLabels () method  
protected function updateLabels():void

Sets the text and positions the labels.

Constant Detail
ALWAYS Constant
public static const ALWAYS:String = always

BOTTOM Constant  
public static const BOTTOM:String = bottom

HORIZONTAL Constant  
public static const HORIZONTAL:String = horizontal

LEFT Constant  
public static const LEFT:String = left

MOVE Constant  
public static const MOVE:String = move

NEVER Constant  
public static const NEVER:String = never

RIGHT Constant  
public static const RIGHT:String = right

TOP Constant  
public static const TOP:String = top

VERTICAL Constant  
public static const VERTICAL:String = vertical