// Copyright 2007. Adobe Systems Incorporated. All Rights Reserved. package fl.events { import flash.events.Event; /** * The SliderEvent class defines events that are associated with the Slider component. * These include the following: * * @see SliderEventClickTarget * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public class SliderEvent extends Event { /** * Defines the value of the type property of a change event object. * *

This event has the following properties:

* * * * * * * * * * *
PropertyValue
bubblesfalse
cancelablefalse; there is no default * behavior to cancel.
clickTargetIdentifies whether the slider track * or a slider thumb was pressed.
currentTargetThe object that is actively processing * the event object with an event listener.
keyCodeIf the event was triggered by a key press, * the code for the key that was pressed.
targetThe object that dispatched the event. The target is * not always the object listening for the event. Use the currentTarget * property to access the object that is listening for the event.
triggerEventThe type of device that triggered the event. A value * of InteractionInputType.MOUSE indicates that a mouse was the source of input; * a value of InteractionInputType.KEYBOARD indicates that a keyboard was * the source of input.
valueThe value of the slider after the event.
* * @eventType change * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public static const CHANGE:String = "change"; /** * Defines the value of the type property of a thumbDrag event * object. * *

This event has the following properties:

* * * * * * * * * * *
PropertyValue
bubblesfalse
cancelablefalse; there is no default * behavior to cancel.
clickTargetIdentifies whether the slider track * or a slider thumb was pressed.
currentTargetThe object that is actively processing * the event object with an event listener.
keyCodeIf the event was triggered by a key press, * the code for the key that was pressed.
targetThe object that dispatched the event. The target is * not always the object listening for the event. Use the currentTarget * property to access the object that is listening for the event.
triggerEventThe type of device that triggered the event. A value * of InteractionInputType.MOUSE indicates that a mouse was the source of the * input; a value of InteractionInputType.KEYBOARD indicates that a keyboard * was the source of the input.
valueThe value of the slider after the event.
* * @eventType thumbDrag * * @see #THUMB_PRESS * @see #THUMB_RELEASE * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public static const THUMB_DRAG:String = "thumbDrag"; /** * Defines the value of the type property of a thumbPress * event object. * *

This event has the following properties:

* * * * * * * * * * *
PropertyValue
bubblesfalse
cancelablefalse; there is no default * behavior to cancel.
clickTargetIdentifies whether the slider track * or a slider thumb was pressed.
currentTargetThe object that is actively processing * the event object with an event listener.
keyCodeIf the event was triggered by a key press, * the code for the key that was pressed.
targetThe object that dispatched the event. The target is * not always the object listening for the event. Use the currentTarget * property to access the object that is listening for the event.
triggerEventThe type of device that triggered the event. A value * of InteractionInputType.MOUSE indicates that a mouse was the source of the * input; a value of InteractionInputType.KEYBOARD indicates that a keyboard * was the source of the input.
valueThe value of the slider after the event.
* * @eventType thumbPress * * @see #THUMB_DRAG * @see #THUMB_RELEASE * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public static const THUMB_PRESS:String = "thumbPress"; /** * Defines the value of the type property of a thumbRelease * event object. * *

This event has the following properties:

* * * * * * * * * * *
PropertyValue
bubblesfalse
cancelablefalse; there is no default * behavior to cancel.
clickTargetIdentifies whether the slider track * or a slider thumb was pressed.
currentTargetThe object that is actively processing * the event object with an event listener.
keyCodeIf the event was triggered by a key press, * the code for the key that was pressed.
targetThe object that dispatched the event. The target is * not always the object listening for the event. Use the currentTarget * property to access the object that is listening for the event.
triggerEventThe type of device that triggered the event. A value * of InteractionInputType.MOUSE indicates that a mouse was the source of the * input; a value of InteractionInputType.KEYBOARD indicates that a keyboard * was the source of the input.
valueThe value of the slider after the event.
* * @eventType thumbRelease * * @see #THUMB_DRAG * @see #THUMB_PRESS * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public static const THUMB_RELEASE:String = "thumbRelease"; /** * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ protected var _triggerEvent:String; /** * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ protected var _value:Number; /** * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ protected var _keyCode:Number; /** * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ protected var _clickTarget:String; /** * Gets the new value of the slider, based on its position. * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function get value():Number { return _value; } /** * Gets the key code for the key that was pressed to trigger the event. * A key code is a numeric value that identifies the key that was pressed. * * @see flash.events.KeyboardEvent#keyCode * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function get keyCode():Number { return _keyCode; } /** * Gets the type of device that was used to send the input. A value of InteractionInputType.MOUSE * indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD * indicates that a keyboard was the source of the input. * * @see SliderEventClickTarget SliderEventClickTarget * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function get triggerEvent():String { return _triggerEvent; } /** * Gets a string that indicates whether the slider thumb or a slider track was pressed. * A value of SliderEventClickTarget.THUMB indicates that the slider thumb was * pressed; a value of SliderEventClickTarget.TRACK indicates that the slider * track was pressed. * * @see SliderEventClickTarget SliderEventClickTarget * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function get clickTarget():String { return _clickTarget; } /** * Creates a new SliderEvent object with the specified parameters. * * @param type The event type; this value identifies the action that triggered the event. * * @param value The new value of the slider. * * @param clickTarget Indicates whether a slider thumb or the slider track was * pressed. A value of SliderEventClickTarget.THUMB indicates that * the slider thumb was pressed; a value of SliderEventClickTarget.TRACK * indicates that the slider track was pressed. * * @param triggerEvent A String that indicates the source of the input. A value of * InteractionInputType.MOUSE indicates that the mouse was the source of input; * a value of InteractionInputType.KEYBOARD indicates that the keyboard was * the source of input. * * @param keyCode If the event was triggered by a key press, this value is the key code * that identifies that key. * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function SliderEvent(type:String, value:Number, clickTarget:String, triggerEvent:String, keyCode:int=0) { _value = value; _keyCode = keyCode; _triggerEvent = triggerEvent; _clickTarget = clickTarget; super(type); } /** * Returns a string that contains all the properties of the SliderEvent object. The * string is in the following format: * *

[SliderEvent type=value value=value * bubbles=value cancelable=value keycode=value * triggerEvent=value clickTarget=value]

* * @return A string representation of the SliderEvent object. * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ override public function toString():String { return formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"); } /** * Creates a copy of the SliderEvent object and sets the value of each parameter to match * the original. * * @return A copy of the current SliderEvent instance. * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ override public function clone():Event { return new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode); } } }