(Beta)
Package | fl.events |
Class | public class SliderEventClickTarget |
Inheritance | SliderEventClickTarget Object |
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS3 |
Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
clickTarget
property of the SliderEvent class.
Related API Elements
Public Properties
Public Methods
Public Constants
Constant | Defined 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.
Examples How to use this example
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.
- Drag a Slider onto the stage and name it
slider
. - Drag a Label component onto the stage and name it
sliderLabel
. - Save this code as SliderEventClickTargetExample.as in the same directory as your FLA.
- 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; } } } }
Wed Nov 21 2018, 06:34 AM -08:00