ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
fl.events 

SliderEventClickTarget  - AS3 Flash

Packagefl.events
Classpublic class SliderEventClickTarget
InheritanceSliderEventClickTarget Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

The SliderEventClickTarget class defines constants for the values of the clickTarget property of the SliderEvent class.

View the examples

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  THUMB : String = "thumb"
[static] The Slider thumb was clicked.
SliderEventClickTarget
  TRACK : String = "track"
[static] The Slider track was clicked.
SliderEventClickTarget
Constant Detail

THUMB

Constant
public static const THUMB:String = "thumb"

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

The Slider thumb was clicked.

TRACK

Constant 
public static const TRACK:String = "track"

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

The Slider track was clicked.

SliderEventClickTargetExample.as

This example demonstrates how to determine whether a Slider instance has been clicked on the thumb or on the track of the slider.
  1. Drag a Slider onto the stage and name it slider.
  2. Drag a Label component onto the stage and name it sliderLabel.
  3. Save this code as SliderEventClickTargetExample.as in the same directory as your FLA.
  4. Set the DocumentClass in the FLA to SliderEventClickTargetExample.
package
{
    import flash.display.Sprite;
    import fl.events.SliderEvent;
    import fl.events.SliderEventClickTarget;
    
    public class SliderEventClickTargetExample extends Sprite    
    {
        public function SliderEventClickTargetExample() {
            slider.addEventListener(SliderEvent.CHANGE, analyzeSliderInput);
            sliderLabel.autoSize = "left";
            sliderLabel.text = "Select and move slider with keyboard or mouse";
        }
        private function analyzeSliderInput(e:SliderEvent):void {
            switch(e.clickTarget) {
                case SliderEventClickTarget.THUMB:
                    sliderLabel.text = "Slider has been clicked on the thumb";                
                    break;
                case SliderEventClickTarget.TRACK:
                    sliderLabel.text = "Slider has been clicked on the track";
                    break;
                default:
                    break;
            }
        }
    }
}