Packagecom.eqsim.components
Classpublic class Slider
InheritanceSlider Inheritance fl.core.UIComponent

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.



    Public Properties
     PropertyDefined By
      clickSoundClass : String
    The class name of an audio clip to play on value change (if useSound == true).
    Slider
      discreteStep : Boolean = false
    Boolean property saying whether steps or discrete or continuous.
    Slider
      evtChange : String = onChange
    The name of the event.
    Slider
      evtDisabled : String = onDisabled
    Let user change the event name, if desired.
    Slider
      gutClicks : Boolean
    Boolean property saying whether to allow value change if the user clicks on a place in the gutter.
    Slider
      gutterClassName : String
    The class name of the 'gutter' (the thing on which the thumb slides) Sprite.
    Slider
      maxVal : Number
    Maximum value for the slider.
    Slider
      minVal : Number
    Minimum value for the slider.
    Slider
      numDivs : int
    Number of divisions, for discrete slider (and tick marks).
    Slider
      showHand : Boolean
    Boolean property indicating whether or not to display the hand cursor when the cursor is over the hit area of this component.
    Slider
      showTicks : Boolean
    Boolean property indicating whether or not to show tick marks.
    Slider
      _sideClassName : String = defSliderSide
    Slider
      sideClassName : String
    The class name of the side of the gutter.
    Slider
      thumbClassName : String
    The linkage ID of the thumb (indicator).
    Slider
      tickLineColor : int
    Slider
      tickLineLength : int
    Slider
      tickLineThickness : int
    Slider
      useSound : Boolean
    Whether or not to play the sound on a value change (default is false, do not play sound).
    Slider
      val : Number
    Current slider value.
    Slider
    Protected Properties
     PropertyDefined By
      _clickSoundClass : String = aSliderClickSound
    Slider
      _gutterClassName : String = defSliderBkgnd
    Slider
      gutterClip : Sprite
    Slider
      indOffset : Number
    Slider
      leftPos : Number
    Slider
      leftSideClip : Sprite
    Slider
      rightPos : Number
    Slider
      rightSideClip : Sprite
    Slider
      _showHand : Boolean = true
    Slider
      sliderContainer : Sprite
    Slider
      sndObj : Sound
    Slider
      _thumbClassName : String = defSliderThumb
    Slider
      thumbClip : Sprite
    Slider
      tickClip : Sprite
    Slider
      _tickLineColor : int = 0
    Slider
      _tickLineLength : Number = 10
    Slider
      _tickLineThickness : Number = 2
    Slider
      _useSound : Boolean = false
    Slider
      _valRange : Number
    Slider
    Public Methods
     MethodDefined By
      
    Slider
      
    destroy():void
    Slider
    Protected Methods
     MethodDefined By
      
    changeGutter(gut:String, side:String):void
    Slider
      
    changeThumb(n:String):void
    Slider
      
    configUI():void
    [override] configUI Get the display objects created in preparation of launch.
    Slider
      
    draw():void
    [override]
    Slider
      
    drawTicks():void
    Slider
      
    gutterClick(me:MouseEvent):void
    Slider
      
    playClick():void
    Slider
      
    setClickSound(s:String):void
    Slider
      
    Slider
      
    thumbEngage(me:MouseEvent):void
    Slider
      
    thumbMove(me:MouseEvent):void
    Slider
      
    thumbRelease(me:MouseEvent):void
    Slider
    Events
     Event Summary Defined By
      Event generated when the indicator reaches a new value.Slider
      Event generated when slider is set as enabled == false.Slider
    Property Detail
    _clickSoundClassproperty
    protected var _clickSoundClass:String = aSliderClickSound

    _gutterClassNameproperty 
    protected var _gutterClassName:String = defSliderBkgnd

    _showHandproperty 
    protected var _showHand:Boolean = true

    _sideClassNameproperty 
    public var _sideClassName:String = defSliderSide

    _thumbClassNameproperty 
    protected var _thumbClassName:String = defSliderThumb

    _tickLineColorproperty 
    protected var _tickLineColor:int = 0

    _tickLineLengthproperty 
    protected var _tickLineLength:Number = 10

    _tickLineThicknessproperty 
    protected var _tickLineThickness:Number = 2

    _useSoundproperty 
    protected var _useSound:Boolean = false

    _valRangeproperty 
    protected var _valRange:Number

    clickSoundClassproperty 
    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
    discreteStepproperty 
    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.

    evtChangeproperty 
    public var evtChange:String = onChange

    The name of the event. Change this programmatically to change the event name.

    evtDisabledproperty 
    public var evtDisabled:String = onDisabled

    Let user change the event name, if desired.

    gutClicksproperty 
    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
    gutterClassNameproperty 
    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
    gutterClipproperty 
    protected var gutterClip:Sprite

    indOffsetproperty 
    protected var indOffset:Number

    leftPosproperty 
    protected var leftPos:Number

    leftSideClipproperty 
    protected var leftSideClip:Sprite

    maxValproperty 
    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
    minValproperty 
    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
    numDivsproperty 
    numDivs:int

    Number of divisions, for discrete slider (and tick marks).


    Implementation
        public function get numDivs():int
        public function set numDivs(value:int):void
    rightPosproperty 
    protected var rightPos:Number

    rightSideClipproperty 
    protected var rightSideClip:Sprite

    showHandproperty 
    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
    showTicksproperty 
    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
    sideClassNameproperty 
    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
    sliderContainerproperty 
    protected var sliderContainer:Sprite

    sndObjproperty 
    protected var sndObj:Sound

    thumbClassNameproperty 
    thumbClassName:String

    The linkage ID of the thumb (indicator).


    Implementation
        public function get thumbClassName():String
        public function set thumbClassName(value:String):void
    thumbClipproperty 
    protected var thumbClip:Sprite

    tickClipproperty 
    protected var tickClip:Sprite

    tickLineColorproperty 
    tickLineColor:int


    Implementation
        public function get tickLineColor():int
        public function set tickLineColor(value:int):void
    tickLineLengthproperty 
    tickLineLength:int


    Implementation
        public function get tickLineLength():int
        public function set tickLineLength(value:int):void
    tickLineThicknessproperty 
    tickLineThickness:int


    Implementation
        public function get tickLineThickness():int
        public function set tickLineThickness(value:int):void
    useSoundproperty 
    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
    valproperty 
    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
    Constructor Detail
    Slider()Constructor
    public function Slider()

    Method Detail
    changeGutter()method
    protected function changeGutter(gut:String, side:String):void

    Parameters

    gut:String
     
    side:String

    changeThumb()method 
    protected function changeThumb(n:String):void

    Parameters

    n:String

    configUI()method 
    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!

    destroy()method 
    public function destroy():void

    draw()method 
    override protected function draw():void

    drawTicks()method 
    protected function drawTicks():void

    gutterClick()method 
    protected function gutterClick(me:MouseEvent):void

    Parameters

    me:MouseEvent

    playClick()method 
    protected function playClick():void

    setClickSound()method 
    protected function setClickSound(s:String):void

    Parameters

    s:String

    setGutterClicking()method 
    protected function setGutterClicking():void

    thumbEngage()method 
    protected function thumbEngage(me:MouseEvent):void

    Parameters

    me:MouseEvent

    thumbMove()method 
    protected function thumbMove(me:MouseEvent):void

    Parameters

    me:MouseEvent

    thumbRelease()method 
    protected function thumbRelease(me:MouseEvent):void

    Parameters

    me:MouseEvent

    Event Detail
    onChange Event

    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.

    onDisabled Event  

    Event generated when slider is set as enabled == false. You can change the name of the event in the evtDisabled property.