Package | com.bit101.components |
Class | public class Slider |
Inheritance | Slider ![]() ![]() |
Subclasses | HSlider, VSlider |
Property | Defined By | ||
---|---|---|---|
backClick : Boolean
Sets / gets whether or not a click on the background of the slider will move the handler to that position.
|
Slider | ||
![]() |
enabled : Boolean
Sets/gets whether this component is enabled or not.
|
Component | |
![]() |
height : Number [override]
Sets/gets the height of the component.
|
Component | |
maximum : Number
Gets / sets the maximum value of this slider.
|
Slider | ||
minimum : Number
Gets / sets the minimum value of this slider.
|
Slider | ||
![]() |
tag : int
Sets/gets in integer that can identify the component.
|
Component | |
tick : Number
Gets / sets the tick value of this slider.
|
Slider | ||
value : Number
Sets / gets the current value of this slider.
|
Slider | ||
![]() |
width : Number [override]
Sets/gets the width of the component.
|
Component | |
![]() |
x : Number [override] [write-only]
Overrides the setter for x to always place the component on a whole pixel.
|
Component | |
![]() |
y : Number [override] [write-only]
Overrides the setter for y to always place the component on a whole pixel.
|
Component |
Property | Defined By | ||
---|---|---|---|
_back : Sprite | Slider | ||
_backClick : Boolean = true | Slider | ||
![]() |
_enabled : Boolean = true | Component | |
_handle : Sprite | Slider | ||
![]() |
_height : Number = 0 | Component | |
_max : Number = 100 | Slider | ||
_min : Number = 0 | Slider | ||
_orientation : String | Slider | ||
![]() |
Ronda : Class | Component | |
![]() |
_tag : int = -1 | Component | |
_tick : Number = 1 | Slider | ||
_value : Number = 0 | Slider | ||
![]() |
_width : Number = 0 | Component |
Method | Defined By | ||
---|---|---|---|
Slider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)
Constructor
|
Slider | ||
draw():void
[override]
Draws the visual ui of the component.
|
Slider | ||
![]() |
initStage(stage:Stage):void
[static]
Utility method to set up usual stage align and scaling.
|
Component | |
![]() |
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
|
Component | |
![]() |
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 |
Method | Defined By | ||
---|---|---|---|
addChildren():void
[override]
Creates and adds the child display objects of this component.
|
Slider | ||
correctValue():void
Adjusts value to be within minimum and maximum.
|
Slider | ||
drawBack():void
Draws the back of the slider.
|
Slider | ||
drawHandle():void
Draws the handle of the slider.
|
Slider | ||
![]() |
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
|
Component | |
init():void
[override]
Initializes the component.
|
Slider | ||
![]() |
invalidate():void
Marks the component to be redrawn on the next frame.
|
Component | |
onBackClick(event:MouseEvent):void
Handler called when user clicks the background of the slider, causing the handle to move to that point.
|
Slider | ||
onDrag(event:MouseEvent):void
Internal mouseDown handler.
|
Slider | ||
onDrop(event:MouseEvent):void
Internal mouseUp handler.
|
Slider | ||
![]() |
onInvalidate(event:Event):void
Called one frame after invalidate is called.
|
Component | |
onSlide(event:MouseEvent):void
Internal mouseMove handler for when the handle is being moved.
|
Slider | ||
positionHandle():void
Adjusts position of handle when value, maximum or minimum have changed.
|
Slider |
Constant | Defined By | ||
---|---|---|---|
![]() |
DRAW : String = draw [static]
|
Component | |
HORIZONTAL : String = horizontal [static]
|
Slider | ||
VERTICAL : String = vertical [static]
|
Slider |
_back | property |
protected var _back:Sprite
_backClick | property |
protected var _backClick:Boolean = true
_handle | property |
protected var _handle:Sprite
_max | property |
protected var _max:Number = 100
_min | property |
protected var _min:Number = 0
_orientation | property |
protected var _orientation:String
_tick | property |
protected var _tick:Number = 1
_value | property |
protected var _value:Number = 0
backClick | property |
backClick:Boolean
Sets / gets whether or not a click on the background of the slider will move the handler to that position.
public function get backClick():Boolean
public function set backClick(value:Boolean):void
maximum | property |
maximum:Number
Gets / sets the maximum value of this slider.
public function get maximum():Number
public function set maximum(value:Number):void
minimum | property |
minimum:Number
Gets / sets the minimum value of this slider.
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.
public function get tick():Number
public function set tick(value:Number):void
value | property |
value:Number
Sets / gets the current value of this slider.
public function get value():Number
public function set value(value:Number):void
Slider | () | Constructor |
public function Slider(orientation:String, parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultHandler:Function = null)
Constructor
Parameters
orientation:String (default = NaN ) — 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).
|
addChildren | () | method |
override protected function addChildren():void
Creates and adds the child display objects of this component.
correctValue | () | method |
protected function correctValue():void
Adjusts value to be within minimum and maximum.
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.
drawHandle | () | method |
protected function drawHandle():void
Draws the handle of the slider.
init | () | method |
override protected function init():void
Initializes the component.
onBackClick | () | method |
protected function onBackClick(event:MouseEvent):void
Handler called when user clicks the background of the slider, causing the handle to move to that point. Only active if backClick is true.
Parameters
event:MouseEvent — The MouseEvent passed by the system.
|
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.
|
HORIZONTAL | Constant |
public static const HORIZONTAL:String = horizontal
VERTICAL | Constant |
public static const VERTICAL:String = vertical