Packagecom.bit101.components
Classpublic class Slider
InheritanceSlider Inheritance Component Inheritance flash.display.Sprite
SubclassesHSlider, VSlider



Public Properties
 PropertyDefined by
  backClick : Boolean
Slider
 Inheritedheight : Number
Component
  maximum : Number
Slider
  minimum : Number
Slider
  value : Number
Slider
 Inheritedwidth : Number
Component
 Inheritedx : Number
Overrides the setter for x to always place the component on a whole pixel.
Component
 Inheritedy : Number
Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
 PropertyDefined by
  _handle : Sprite
Slider
 Inherited_height : Number = 0
Component
  _max : Number = 100
Slider
  _min : Number = 0
Slider
  _orientation : String
Slider
  _value : Number = 0
Slider
 Inherited_width : Number = 0
Component
Public Methods
 MethodDefined by
  
Slider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)
Constructor
Slider
  
draw():void
Draws the visual ui of the component.
Slider
 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
  
setSliderParams(min:Number, max:Number, value:Number):void
Convenience method to set the three main parameters in one shot.
Slider
Protected Methods
 MethodDefined by
  
addChildren():void
Creates and adds the child display objects of this component.
Slider
  
drawBack():void
Draws the back of the slider.
Slider
  
drawHandle():void
Draws the handle of the slider.
Slider
 Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
  
init():void
Initializes the component.
Slider
 Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
  
onDrag(event:MouseEvent):void
Internal mouseDown handler.
Slider
  
onDrop(event:MouseEvent):void
Internal mouseUp handler.
Slider
  
onSlide(event:MouseEvent):void
Internal mouseMove handler for when the handle is being moved.
Slider
  
Adjusts position of handle when value, maximum or minimum have changed.
Slider
Public Constants
 ConstantDefined by
 InheritedDRAW : String = "draw"
[static]
Component
  HORIZONTAL : String = "horizontal"
[static]
Slider
  VERTICAL : String = "vertical"
[static]
Slider
Property detail
backClickproperty
backClick:Boolean  [read-write]Implementation
    public function get backClick():Boolean
    public function set backClick(value:Boolean):void
_handleproperty 
protected var _handle:Sprite
_maxproperty 
protected var _max:Number = 100
maximumproperty 
maximum:Number  [read-write]Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
_minproperty 
protected var _min:Number = 0
minimumproperty 
minimum:Number  [read-write]Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
_orientationproperty 
protected var _orientation:String
_valueproperty 
protected var _value:Number = 0
valueproperty 
value:Number  [read-write]Implementation
    public function get value():Number
    public function set value(value:Number):void
Constructor detail
Slider()constructor
public function Slider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)

Constructor

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

Creates and adds the child display objects of this component.

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

Draws the visual ui of the component.

drawBack()method 
protected function drawBack():void

Draws the back of the slider.

drawHandle()method 
protected function drawHandle():void

Draws the handle of the slider.

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

Initializes the component.

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

Internal mouseDown handler. 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.
onSlide()method 
protected function onSlide(event:MouseEvent):void

Internal mouseMove handler for when the handle is being moved.

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

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

setSliderParams()method 
public function setSliderParams(min:Number, max:Number, value:Number):void

Convenience method to set the three main parameters in one shot.

Parameters
min:Number — The minimum value of the slider.
 
max:Number — The maximum value of the slider.
 
value:Number — The value of the slider.
Constant detail
HORIZONTALconstant
public static const HORIZONTAL:String = "horizontal"
VERTICALconstant 
public static const VERTICAL:String = "vertical"