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:

Summary


Constructor
Class properties
Instance properties
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

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.

height

height:Number
(write)

Deprecated Use setHeight.

mArrowDown

private mArrowDown:RepeaterButton
(read)

mArrowUp

private mArrowUp:RepeaterButton
(read)

mEnabled

private mEnabled:Boolean
(read)

mOldScrollerHeight

private mOldScrollerHeight:Number
(read)

mOldTotalHeight

private mOldTotalHeight:Number
(read)

mOldVisibleHeight

private mOldVisibleHeight:Number
(read)

mScroller

private mScroller:DragButton
(read)

mScrollerBg

private mScrollerBg:MovieClip
(read)

mScrollerHeight

private mScrollerHeight:Number
(read)

mScrollTarget

private mScrollTarget:IScrollable
(read)

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.

target

target:IScrollable
(write)

Deprecated Use setTarget.

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:

setHeight

function setHeight (
inHeight:Number) : Void

The total height of the scrollbar in pixels.

setTarget

function setTarget (
inScrollTarget:IScrollable) : Void

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

onDragMove

function onDragMove (
e:DragButtonEvent) : Void

Triggered by scroller.

onEventButtonRelease

function onEventButtonRelease (

Triggered by arrows.

onLoad

function onLoad (
) : Void