This class implements a simple horizontal slider. Users can change the appearance by modifying:
defSliderBkgnd
- gutter along which slider slides
defSliderSide
- left and right sides of the slider
defSliderThumb
- the indicator (button)
The class has two events (onChange
and onDisabled
), but can be changed in the component property panel or programmatically via the
evtChange or evtDisabled properties. The value of the onChange event (in data
) is the new value.
protected var _clickSoundClass:String = aSliderClickSound
protected var _gutterClassName:String = defSliderBkgnd
protected var _showHand:Boolean = true
public var _sideClassName:String = defSliderSide
protected var _thumbClassName:String = defSliderThumb
protected var _tickLineColor:int = 0
protected var _tickLineLength:Number = 10
protected var _tickLineThickness:Number = 2
protected var _useSound:Boolean = false
protected var _valRange:Number
clickSoundClass:String
The class name of an audio clip to play on value change (if useSound == true).
Implementation public function get clickSoundClass():String
public function set clickSoundClass(value:String):void
public var discreteStep:Boolean = false
Boolean property saying whether steps or discrete or continuous. If true, discrete steps
are based on numDivs
. If false, slider is continuous.
public var evtChange:String = onChange
The name of the event. Change this programmatically to change the event name.
public var evtDisabled:String = onDisabled
Let user change the event name, if desired.
gutClicks:Boolean
Boolean property saying whether to allow value change if the user clicks on a place in the gutter.
Implementation public function get gutClicks():Boolean
public function set gutClicks(value:Boolean):void
gutterClassName:String
The class name of the 'gutter' (the thing on which the thumb slides) Sprite.
Implementation public function get gutterClassName():String
public function set gutterClassName(value:String):void
protected var gutterClip:Sprite
protected var indOffset:Number
protected var leftPos:Number
protected var leftSideClip:Sprite
maxVal:Number
Maximum value for the slider. Use setMinMax()
to change the value.
Implementation public function get maxVal():Number
public function set maxVal(value:Number):void
minVal:Number
Minimum value for the slider. Use setMinMax()
to change the value.
Implementation public function get minVal():Number
public function set minVal(value:Number):void
numDivs:int
Number of divisions, for discrete slider (and tick marks).
Implementation public function get numDivs():int
public function set numDivs(value:int):void
protected var rightPos:Number
protected var rightSideClip:Sprite
showHand:Boolean
Boolean property indicating whether or not to display the hand cursor when the cursor is
over the hit area of this component.
Implementation public function get showHand():Boolean
public function set showHand(value:Boolean):void
showTicks:Boolean
Boolean property indicating whether or not to show tick marks. Tick marks are really only
for placement, as you really should hand-design slider backgrounds for best effect.
Implementation public function get showTicks():Boolean
public function set showTicks(value:Boolean):void
sideClassName:String
The class name of the side of the gutter. This class is used directly on the right of the gutter, and inverted for the left side.
Implementation public function get sideClassName():String
public function set sideClassName(value:String):void
protected var sliderContainer:Sprite
protected var sndObj:Sound
thumbClassName:String
The linkage ID of the thumb (indicator).
Implementation public function get thumbClassName():String
public function set thumbClassName(value:String):void
protected var thumbClip:Sprite
protected var tickClip:Sprite
tickLineColor:int
Implementation public function get tickLineColor():int
public function set tickLineColor(value:int):void
tickLineLength:int
Implementation public function get tickLineLength():int
public function set tickLineLength(value:int):void
tickLineThickness:int
Implementation public function get tickLineThickness():int
public function set tickLineThickness(value:int):void
useSound:Boolean
Whether or not to play the sound on a value change (default is false, do not play sound).
Implementation public function get useSound():Boolean
public function set useSound(value:Boolean):void
val:Number
Current slider value. Set this property to move the indicator programmatically, or use
it to retrieve the current indicator position.
Implementation public function get val():Number
public function set val(value:Number):void
protected function changeGutter(gut:String, side:String):void
Parameters
protected function changeThumb(n:String):void
Parameters
override protected function configUI():void
configUI
Get the display objects created in preparation of launch. Note that we get called before
our constructor, and before we are notified that we are on the stage!
public function destroy():void
override protected function draw():void
protected function drawTicks():void
protected function gutterClick(me:MouseEvent):void
Parameters
protected function playClick():void
protected function setClickSound(s:String):void
Parameters
protected function setGutterClicking():void
protected function thumbEngage(me:MouseEvent):void
Parameters
protected function thumbMove(me:MouseEvent):void
Parameters
protected function thumbRelease(me:MouseEvent):void
Parameters
Event generated when the indicator reaches a new value. The value passed in the event is the new value. You can change the name of the event in the evtChange
property.
of the slider.
Event generated when slider is set as enabled == false
. You can change the name of the event in the evtDisabled
property.
Thu Dec 15 2011, 12:05 AM -05:00