ScrollBar
| Kind of class: | class |
|---|---|
| Inherits from: | EventMovieClip < MovieClip |
| Author: | Martijn de Visser |
| Classpath: | org.asapframework.ui.scrollbar.ScrollBar |
| File last modified: | Sunday, 08 October 2006, 10:08:09 |
ScrollBar class to create scrollbars with. Assumes the presence of 4 other clips:
- 'scroller_mc' DragButton, scrollable handle
- 'scrollerBg_mc' MovieClip, background of scrollbar
- 'arrowUp_mc' RepeaterButton, scroll up arrow
- 'arrowDown_mc' RepeaterButton, scroll down arrow
To do:
- Support for orientation so horizontal scrollbars are possible as well.
Events broadcasted to listeners:
- ScrollEvent with type:
ON_SCROLL_CONTENT- (null)
Summary
Constructor
Class properties
- DEFAULT_MIN_HEIGHT : Number
- mMinHeight : Number
Instance properties
- mEnabled : Boolean
- mScroller : DragButton
- mScrollerBg : MovieClip
- mArrowUp : RepeaterButton
- mArrowDown : RepeaterButton
- mScrollTarget : IScrollable
- mSnap : Number
- mScrollerHeight : Number
- mOldScrollerHeight : Number
- mVisibleHeight : Number
- mOldVisibleHeight : Number
- mTotalHeight : Number
- mOldTotalHeight : Number
- target (inScrollTarget:IScrollable
- height (inHeight:Number) : Number
- snapping (inValue:Number)
- The number of pixels to snap to.
- enabled : Boolean
- The enabled state of ScrollBar.
Instance properties inherited from EventMovieClip
Instance methods
- update : Void
- Updates the scroller.
- scroll (inDirection:Number) : Void
- Programmatically scrolls the scrollbar.
- alignScroller : Void
- Aligns the scroller to the position of the content
- setTarget (inScrollTarget:IScrollable) : Void
- The target clip to scroll.
- setHeight (inHeight:Number) : Void
- The total height of the scrollbar in pixels.
- alignContent : Void
- Aligns the content to the position of the scroller.
- getPos (inDirection:Number) : Number
- Is this method used?
Event handlers
- onLoad : Void
- onDragMove (e:DragButtonEvent) : Void
- Triggered by scroller.
- onEventButtonRelease (e:EventButtonEvent) : Void
- Triggered by arrows.
Constructor
ScrollBar
function ScrollBar (
)
Class properties
DEFAULT_MIN_HEIGHT
static private DEFAULT_MIN_HEIGHT:Number = 10
(read)
mMinHeight
static private mMinHeight:Number = DEFAULT_MIN_HEIGHT
(read)
Instance properties
enabled
enabled:Boolean
(read,write)
The enabled state of ScrollBar.
mArrowDown
mArrowUp
mEnabled
private mEnabled:Boolean
(read)
mOldScrollerHeight
private mOldScrollerHeight:Number
(read)
mOldTotalHeight
private mOldTotalHeight:Number
(read)
mOldVisibleHeight
private mOldVisibleHeight:Number
(read)
mScroller
mScrollerBg
private mScrollerBg:MovieClip
(read)
mScrollerHeight
private mScrollerHeight:Number
(read)
mScrollTarget
mSnap
private mSnap:Number
(read)
mTotalHeight
private mTotalHeight:Number
(read)
mVisibleHeight
private mVisibleHeight:Number
(read)
snapping
snapping
(write)
The number of pixels to snap to.
Instance methods
alignContent
private function alignContent (
) : Void
Aligns the content to the position of the scroller.
alignScroller
function alignScroller (
) : Void
Aligns the scroller to the position of the content
getPos
private function getPos (
inDirection:Number) : Number
Is this method used?
scroll
function scroll (
inDirection:Number) : Void
Programmatically scrolls the scrollbar.
Events broadcasted to listeners:
- ScrollEvent with type:
ON_SCROLL_CONTENT- (null)
setHeight
function setHeight (
inHeight:Number) : Void
The total height of the scrollbar in pixels.
setTarget
The target clip to scroll. This target should implement the IScrollable interface. The target will automatically be added to the listener queue and receive the 'onScroll' event.
Parameters:
inScrollTarget:
update
function update (
) : Void
Updates the scroller.
Event handlers
onLoad
function onLoad (
) : Void