Packagecom.gestureworks.cml.elements
Classpublic class Slider
InheritanceSlider Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite
Subclasses ProgressBar

The Slider element creates s horizontal or vertical slider that reponds touch and mouse input. It also allows for the input value to be fed through a function call, allowing the slider to updated by another process. The slider can be orientated horizontally or vertically. It can act as a continuous slider or one that snaps to x-number of discrete steps.

See also

ScrollBar


Public Properties
 PropertyDefined By
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  discrete : Boolean
Sets the slider's mode
Slider
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
 Inheritedgroup : String
TouchContainer
  height : Number
[override]
Slider
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
  hit : *
Sets the slider's hit area
Slider
 Inheritedid : String
Returns the object's id.
TouchContainer
  knob : *
Sets the slider's knob element
Slider
  knobColor : uint
Color of default knob
Slider
  knobPosition : Number
[read-only] Stores the current knobPosition in pixels
Slider
  knobRadius : Number
Radius of default knob
Slider
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  max : Number
Sets the max output value
Slider
  min : Number
Sets the min output value
Slider
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  orientation : String
Sets the orientation of the slider, choose horizontal or vertical
Slider
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
 Inheritedposition : *
Sets the position
TouchContainer
  rail : *
Sets the slider's rail element
Slider
  railAlpha : Number
Alpha of default rail
Slider
  railColor : uint
Color of default rail
Slider
  railLineColor : uint
Color of default rail line
Slider
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
  releaseInertia : Boolean
[override] Turns gestureReleaseInertia off and on
Slider
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
  steps : int
Sets the number of discrete steps used when discrete is true
Slider
 InheritedtoBitmap : Boolean
TouchContainer
  touchKnob : TouchContainer
Slider
  value : Number
[read-only] Stores the current value as mapped to the min and max values.
Slider
  width : Number
[override]
Slider
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
  defaultKnob : DisplayObject
[read-only] Provides default knob graphic when one is not provided.
Slider
Public Methods
 MethodDefined By
  
Constructor
Slider
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
  
clone():*
[override]
Slider
  
Slider
  
dispose():void
[override] Destructor
Slider
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
init():void
[override] Initializes the slider object
Slider
  
input(val:Number):void
Sets the value of the slider.
Slider
  
isHorizontal():Boolean
Convenience orientation flag
Slider
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
  
reset():void
Resets the knob position
Slider
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
 Inherited
method sets the dimensions of each child
TouchContainer
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
  
Slider
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Protected Methods
 MethodDefined By
  
onDownHit(event:*):void
Slider
  
onDrag(event:GWGestureEvent):void
Slider
  
setupUI():void
Generates default elements
Slider
Property Detail
defaultKnobproperty
defaultKnob:DisplayObject  [read-only]

Provides default knob graphic when one is not provided. External to allow subclasses to bypass knob requirement.


Implementation
    protected function get defaultKnob():DisplayObject
discreteproperty 
discrete:Boolean

Sets the slider's mode

The default value is true.


Implementation
    public function get discrete():Boolean
    public function set discrete(value:Boolean):void
heightproperty 
height:Number[override]


Implementation
    public function get height():Number
    public function set height(value:Number):void
hitproperty 
hit:*

Sets the slider's hit area

The default value is null.


Implementation
    public function get hit():*
    public function set hit(value:any):void
knobproperty 
knob:*

Sets the slider's knob element

The default value is null.


Implementation
    public function get knob():*
    public function set knob(value:any):void
knobColorproperty 
knobColor:uint

Color of default knob


Implementation
    public function get knobColor():uint
    public function set knobColor(value:uint):void
knobPositionproperty 
knobPosition:Number  [read-only]

Stores the current knobPosition in pixels

The default value is 0.


Implementation
    public function get knobPosition():Number
knobRadiusproperty 
knobRadius:Number

Radius of default knob


Implementation
    public function get knobRadius():Number
    public function set knobRadius(value:Number):void
maxproperty 
max:Number

Sets the max output value

The default value is 100.


Implementation
    public function get max():Number
    public function set max(value:Number):void
minproperty 
min:Number

Sets the min output value

The default value is 0.


Implementation
    public function get min():Number
    public function set min(value:Number):void
orientationproperty 
orientation:String

Sets the orientation of the slider, choose horizontal or vertical

The default value is horizontal.


Implementation
    public function get orientation():String
    public function set orientation(value:String):void
railproperty 
rail:*

Sets the slider's rail element

The default value is null.


Implementation
    public function get rail():*
    public function set rail(value:any):void
railAlphaproperty 
railAlpha:Number

Alpha of default rail


Implementation
    public function get railAlpha():Number
    public function set railAlpha(value:Number):void
railColorproperty 
railColor:uint

Color of default rail


Implementation
    public function get railColor():uint
    public function set railColor(value:uint):void
railLineColorproperty 
railLineColor:uint

Color of default rail line


Implementation
    public function get railLineColor():uint
    public function set railLineColor(value:uint):void
releaseInertiaproperty 
releaseInertia:Boolean[override]

Turns gestureReleaseInertia off and on

The default value is false.


Implementation
    public function get releaseInertia():Boolean
    public function set releaseInertia(value:Boolean):void
stepsproperty 
steps:int

Sets the number of discrete steps used when discrete is true

The default value is 3.


Implementation
    public function get steps():int
    public function set steps(value:int):void
touchKnobproperty 
public var touchKnob:TouchContainer

valueproperty 
value:Number  [read-only]

Stores the current value as mapped to the min and max values. Can be used as input value, set input=true

The default value is 0.


Implementation
    public function get value():Number
widthproperty 
width:Number[override]


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
Slider()Constructor
public function Slider()

Constructor

Method Detail
clone()method
override public function clone():*

Returns
*
createEvents()method 
public function createEvents():void

dispose()method 
override public function dispose():void

Destructor

init()method 
override public function init():void

Initializes the slider object

input()method 
public function input(val:Number):void

Sets the value of the slider. Can set mouseInput=false to disable touch/mouse interaction.

Parameters

val:Number — Input value contrained to output min and max

isHorizontal()method 
public function isHorizontal():Boolean

Convenience orientation flag

Returns
Boolean — true if horizontal, false otherwise
onDownHit()method 
protected function onDownHit(event:*):void

Parameters

event:*

onDrag()method 
protected function onDrag(event:GWGestureEvent):void

Parameters

event:GWGestureEvent

reset()method 
public function reset():void

Resets the knob position

setupUI()method 
protected function setupUI():void

Generates default elements

updateLayout()method 
public function updateLayout():void