Packagecom.bit101.components
Classpublic class UISlider
InheritanceUISlider Inheritance Component Inheritance flash.display.Sprite
SubclassesHUISlider, VUISlider



Public Properties
 PropertyDefined by
 Inheritedheight : Number
Component
  label : String
UISlider
  labelPrecision : int
UISlider
  maximum : Number
UISlider
  minimum : Number
UISlider
  value : Number
UISlider
 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
 Inherited_height : Number = 0
Component
  _label : Label
UISlider
  _slider : Slider
UISlider
  _sliderClass : Class
UISlider
  _valueLabel : Label
UISlider
 Inherited_width : Number = 0
Component
Public Methods
 MethodDefined by
  
UISlider(parent:DisplayObjectContainer = null, x:Number = 0, y:Number = 0, label:String = "", defaultEventHandler:Function = null)
Constructor
UISlider
  
draw():void
Draws the visual ui of this component.
UISlider
 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.
UISlider
Protected Methods
 MethodDefined by
  
addChildren():void
Creates and adds the child display objects of this component.
UISlider
  
Formats the value of the slider to a string based on the current level of precision.
UISlider
 Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
 Inherited
init():void
Initilizes the component.
Component
 Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
  
Positions the label when it has changed.
UISlider
Public Constants
 ConstantDefined by
 InheritedDRAW : String = "draw"
[static]
Component
Property detail
_labelproperty
protected var _label:Label
labelproperty 
label:String  [read-write]Implementation
    public function get label():String
    public function set label(value:String):void
labelPrecisionproperty 
labelPrecision:int  [read-write]Implementation
    public function get labelPrecision():int
    public function set labelPrecision(value:int):void
maximumproperty 
maximum:Number  [read-write]Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimumproperty 
minimum:Number  [read-write]Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
_sliderproperty 
protected var _slider:Slider
_sliderClassproperty 
protected var _sliderClass:Class
valueproperty 
value:Number  [read-write]Implementation
    public function get value():Number
    public function set value(value:Number):void
_valueLabelproperty 
protected var _valueLabel:Label
Constructor detail
UISlider()constructor
public function UISlider(parent:DisplayObjectContainer = null, x:Number = 0, y:Number = 0, label:String = "", defaultEventHandler:Function = null)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this UISlider.
 
x:Number (default = 0) — The x position to place this component.
 
y:Number (default = 0) — The y position to place this component.
 
label:String (default = "") — The initial string to display as this component's label.
 
defaultEventHandler:Function (default = null) — The event handling function to handle the default event for this component (change in this case).
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 this component.

formatValueLabel()method 
protected function formatValueLabel():void

Formats the value of the slider to a string based on the current level of precision.

positionLabel()method 
protected function positionLabel():void

Positions the label when it has changed. Implemented in child classes.

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.