Package com.bit101.components
Class public class UISlider
Inheritance UISlider InheritanceComponent Inheritance flash.display.Sprite
Subclasses HUISlider, VUISlider



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
    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
  Inherited tag : 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
  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
  Inherited _enabled : Boolean = true
Component
  Inherited _height : Number = 0
Component
    _label : Label
UISlider
    _labelText : String
UISlider
    _precision : int = 1
UISlider
  Inherited Ronda : 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
  Method Defined 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
  Method Defined By
   
addChildren():void
[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
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_label property
protected var _label:Label

_labelText property  
protected var _labelText:String

_precision property  
protected var _precision:int = 1

_slider property  
protected var _slider:Slider

_sliderClass property  
protected var _sliderClass:Class

_tick property  
protected var _tick:Number = 1

_valueLabel property  
protected var _valueLabel:Label

label property  
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
labelPrecision property  
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
maximum property  
maximum:Number

Gets / sets the maximum value of this slider.


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

Gets / sets the minimum value of this 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
value property  
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.