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



Public Properties
 PropertyDefined By
 Inheritedenabled : Boolean
Sets/gets whether this component is enabled or not.
Component
 Inheritedheight : Number
[override] Sets/gets the height of the component.
Component
  label : String
Gets / sets the text shown in this component's label.
UISlider
  labelPrecision : int
Gets / sets the number of decimals to format the value label.
UISlider
  maximum : Number
Gets / sets the maximum value of this slider.
UISlider
  minimum : Number
Gets / sets the minimum value of this slider.
UISlider
 Inheritedtag : int
Sets/gets in integer that can identify the component.
Component
  tick : Number
Gets / sets the tick value of this slider.
UISlider
  value : Number
Sets / gets the current value of this slider.
UISlider
 Inheritedwidth : Number
[override] Sets/gets the width of the component.
Component
 Inheritedx : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
 Inheritedy : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
 PropertyDefined By
 Inherited_enabled : Boolean = true
Component
 Inherited_height : Number = 0
Component
  _label : Label
UISlider
  _labelText : String
UISlider
  _precision : int = 1
UISlider
 InheritedRonda : Class
Component
  _slider : Slider
UISlider
  _sliderClass : Class
UISlider
 Inherited_tag : int = -1
Component
  _tick : Number = 1
UISlider
  _valueLabel : Label
UISlider
 Inherited_width : Number = 0
Component
Public Methods
 MethodDefined By
  
UISlider(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String, defaultHandler:Function = null)
Constructor
UISlider
  
draw():void
[override] 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
  
[override] 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
 Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
  
onSliderChange(event:Event):void
Handler called when the slider's value changes.
UISlider
  
Positions the label when it has changed.
UISlider
Public Constants
 ConstantDefined By
 InheritedDRAW : String = draw
[static]
Component
Property Detail
_labelproperty
protected var _label:Label

_labelTextproperty 
protected var _labelText:String

_precisionproperty 
protected var _precision:int = 1

_sliderproperty 
protected var _slider:Slider

_sliderClassproperty 
protected var _sliderClass:Class

_tickproperty 
protected var _tick:Number = 1

_valueLabelproperty 
protected var _valueLabel:Label

labelproperty 
label:String

Gets / sets the text shown in this component's label.


Implementation
    public function get label():String
    public function set label(value:String):void
labelPrecisionproperty 
labelPrecision:int

Gets / sets the number of decimals to format the value label. Does not affect the actual value of the slider, just the number shown.


Implementation
    public function get labelPrecision():int
    public function set labelPrecision(value:int):void
maximumproperty 
maximum:Number

Gets / sets the maximum value of this slider.


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

Gets / sets the minimum value of this slider.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
tickproperty 
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
valueproperty 
value:Number

Sets / gets the current value of this slider.


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

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this UISlider.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
label:String — The initial string to display as this component's label.
 
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 this component.

formatValueLabel()method 
protected function formatValueLabel():void

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

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

Handler called when the slider's value changes.

Parameters

event:Event — The Event passed by the slider.

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.