thumbPress
event.
*
* @eventType spark.events.TrackBaseEvent.THUMB_DRAG
*/
Event(name="thumbDrag", type="spark.events.TrackBaseEvent")
/**
* Dispatched when the thumb is pressed, meaning
* the user presses the mouse button over the thumb.
*
* @eventType spark.events.TrackBaseEvent.THUMB_PRESS
*/
Event(name="thumbPress", type="spark.events.TrackBaseEvent")
/**
* Dispatched when the thumb is released,
* meaning the user releases the mouse button after
* a thumbPress
event.
*
* @eventType spark.events.TrackBaseEvent.THUMB_RELEASE
*/
Event(name="thumbRelease", type="spark.events.TrackBaseEvent")
/**
* Normal State
*/
SkinState("normal")
/**
* Disabled State
*/
SkinState("disabled")
/**
* Duration in milliseconds for a sliding animation
* when you click on the track to move a thumb. This style is
* used for both Sliders and Scrollbars. For Sliders, any click
* on the track will cause an animation using this style, as the thumb
* will move to the clicked position. For ScrollBars, this style is
* used only when shift-clicking on the track, which causes the thumb
* to move to the clicked position. Clicking on a ScrollBar track when
* the shift key is not pressed will result in paging behavior instead.
* The smoothScrolling
style must also be set on the
* ScrollBar to get animated behavior when shift-clicking.
*
* This duration is for an animation that covers the entire distance of the * track; smaller distances will use a proportionally smaller duration.
* * @default 300 */ Style(name="slideDuration", type="Number", format="Time", inherit="no") /** * The TrackBase class is a base class for components with a track * and one or more thumb buttons, such as Slider and ScrollBar. It * declares two required skin parts:thumb
and
* track
.
* The TrackBase class also provides the code for
* dragging the thumb button, which is shared by the Slider and ScrollBar classes.
*
*
* @see spark.components.supportClasses.Slider
* @see spark.components.supportClasses.ScrollBar
*/
public class TrackBase extends Range
{
include "../core/Version.as";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*/
public function TrackBase():void;
//--------------------------------------------------------------------------
//
// Skins
//
//--------------------------------------------------------------------------
SkinPart(required="false")
/**
* A skin part that defines a button
* that can be dragged along the track to increase or
* decrease the value
property.
* Updates to the value
property
* automatically update the position of the thumb button
* with respect to the track.
*/
public var thumb:Button;
SkinPart(required="false")
/**
* A skin part that defines a button
* that, when pressed, sets the value
property
* to the value corresponding with the current button position on the track.
*/
public var track:Button;
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* Converts a track-relative x,y pixel location into a value between
* the minimum and maximum, inclusive.
*
* TrackBase subclasses must override this method and perform conversions * that take their own geometry into account. * * For example, a vertical slider might compute a value like this: *
* return (y / track.height) * (maximum - minimum); ** * *
By default, this method returns minimum
.
Most subclasses override this method to update the thumb's size, position, and
* visibility, based on the minimum
, maximum
, and value
properties.
By default, this method does nothing.
* */ protected function updateSkinDisplayList():void; /** * Handles themouseWheel
event when the component is in focus. The thumb is
* moved by the amount of the mouse event delta multiplied by the stepSize
.
*/
protected function system_mouseWheelHandler(event:MouseEvent):void;
//---------------------------------
// Thumb dragging handlers
//---------------------------------
/**
* Handle mouse-down events on the scroll thumb. Records
* the mouse down point in clickOffset.
*/
protected function thumb_mouseDownHandler(event:MouseEvent):void;
/**
* Capture mouse-move events anywhere on or off the stage.
* First, we calculate the new value based on the new position
* using calculateNewValue(). Then, we move the thumb to
* the new value's position. Last, we set the value and
* dispatch a "change" event if the value changes.
*/
protected function system_mouseMoveHandler(event:MouseEvent):void;
/**
* Handle mouse-up events anywhere on or off the stage.
*/
protected function system_mouseUpHandler(event:MouseEvent):void;
//---------------------------------
// Track down handlers
//---------------------------------
/**
* Handle mouse-down events for the scroll track. Subclasses
* should override this method if they want the track to
* recognize mouse clicks on the track.
*/
protected function track_mouseDownHandler(event:MouseEvent):void;
}
}
## B Features
----
## Additional Implementation Details
----
none
## Prototype Work
----
## Compiler Work
----
none
## Web Tier Compiler Impact
----
none
## Flex Feature Dependencies
----
* Depends on Range.
## Backwards Compatibility
----
### Syntax changes
None - New Class
### Behavior
None
### Warnings/Deprecation
None
## Accessibility
----
Support Halo equivalent.
## Performance
----
none.
## Globalization
----
none
## Localization
----
### Compiler Features
none.
## QA
----
Yes.
----