Packagecom.gestureworks.cml.element
Classpublic class Slider
InheritanceSlider Inheritance Container Inheritance ContainerFactory Inheritance ElementFactory Inheritance flash.display.Sprite
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
 Inheritedalpha : Number
[override] [write-only] sets the alpha for display objects
ElementFactory
 Inheritedblur : Boolean
Sets the drop shadow effect
ElementFactory
 Inheritedbottom : Number
sets the bottom value
ElementFactory
 InheritedchildList : ChildList
[read-only] store the child list
ContainerFactory
 Inheritedclass_ : String
Object's css class;
ElementFactory
 InheritedclassName : String
sets the class name of displayobject
ElementFactory
 InheritedcmlIndex : int
sets the cml index
ElementFactory
 InheriteddebugStyle : *
sets the debug style
ElementFactory
 InheriteddimensionsTo : String
sets the dimensions of the container
ContainerFactory
  discrete : Boolean
Sets the slider's mode
Slider
 InheriteddisplayEvents : String
Use for dispatch completes.
ElementFactory
 InheriteddropShadow : Boolean
Sets the drop shadow effect
ElementFactory
  gestureReleaseInertia : Boolean
Turns gestureReleaseInertia off and on
Slider
  height : Number
[override]
Slider
 InheritedheightPercent : String
sets the height percent of display object
ElementFactory
  hit : *
Sets the slider's hit area
Slider
 InheritedhorizontalCenter : Number
sets the horizontal center of display object
ElementFactory
 Inheritedid : String
sets the id of child
ElementFactory
 Inheritedindex : int
sets the index of display object
ElementFactory
 InheritedinfoSource : String
sets info source
ContainerFactory
  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 : *
Sets the layout of the container
Container
 InheritedlayoutComplete : Function
Sets the function to call when the layout is complete
Container
 InheritedlayoutList : Dictionary
Defines the layoutlist
Container
 InheritedlayoutUpdate : Function
Sets the function to call when the layout updates
Container
 Inheritedleft : Number
sets left value
ElementFactory
  max : Number
Sets the max output value
Slider
  min : Number
Sets the min output value
Slider
  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.
Container
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
Container
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
Container
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
Container
 Inheritedposition : String
Sets the position
Container
 InheritedpropertyStates : Array
Deprecated: Please Use state
ElementFactory
  rail : *
Sets the slider's rail element
Slider
  railAlpha : Number
Alpha of default rail
Slider
  railColor : uint
Color of default rail
Slider
 Inheritedright : Number
sets the right value
ElementFactory
 Inheritedscale : Number
Sets both the x and y scale values
ElementFactory
 InheritedscaleX : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedscaleY : Number
[override] Sets width of the display object in pixels
ElementFactory
 Inheritedstate : Array
property states array
ElementFactory
  steps : int
Sets the number of discrete steps used when discrete is true
Slider
 Inheritedtop : Number
sets top value
ElementFactory
  touchKnob : TouchContainer
Slider
  value : Number
[read-only] Stores the current value as mapped to the min and max values.
Slider
 InheritedverticalCenter : Number
sets the vertical center of display object
ElementFactory
  width : Number
[override]
Slider
 InheritedwidthPercent : String
sets the percent of width of display object
ElementFactory
Protected Properties
 PropertyDefined By
  defaultKnob : DisplayObject
[read-only] Provides default knob graphic when one is not provided.
Slider
Public Methods
 MethodDefined By
  
Constructor
Slider
 Inherited
This method searches the childlist and add the children
ContainerFactory
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list TODO: This mechanism should be abstracted to better syncrhonize child and display lists
Container
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
Container
 Inherited
childToList(id:String, child:*):void
this method append to the childlist
ContainerFactory
  
clone():*
[override]
Slider
  
Slider
 Inherited
CML callback
ElementFactory
  
dispose():void
[override] Dispose methods and remove listeners
Slider
 Inherited
getIndex(index:int):*
returns childlist index
Container
 Inherited
getKey(key:String):*
returns the childlist key
Container
 Inherited
hideIndex(index:int):void
hides the childlist index
Container
 Inherited
hideKey(key:String):void
hides the childlist key
Container
  
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
parseCML(cml:XMLList):XMLList
[override] Parse cml for local layouts.
Container
 Inherited
postparseCML(cml:XMLList):void
post parses the cml file
ElementFactory
  
reset():void
Resets the knob position
Slider
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
Container
 Inherited
This method sets the dimensions of childlist
ContainerFactory
 Inherited
showIndex(index:int):void
shows the childlist index
Container
 Inherited
showKey(key:String):void
shows the childlist key
Container
  
Slider
 Inherited
updateProperties(state:Number = 0):void
this method updates the properties
ElementFactory
Protected Methods
 MethodDefined By
  
onDownHit(event:*):void
Slider
  
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
gestureReleaseInertiaproperty 
gestureReleaseInertia:Boolean

Turns gestureReleaseInertia off and on

The default value is false.


Implementation
    public function get gestureReleaseInertia():Boolean
    public function set gestureReleaseInertia(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
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

Dispose methods and remove listeners

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