Access keys

ScrollBar

Kind of class: class
Inherits from: EventMovieClip < MovieClip
Author: Martijn de Visser
Classpath: org.asapframework.ui.scrollbar.ScrollBar
File last modified: Saturday, 07 October 2006, 23:53:40
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 broadcast to listeners:
ScrollEvent with type: ON_SCROLL_CONTENT

Constructor

ScrollBar

function ScrollBar (
)

Instance properties

enabled

enabled:Boolean
(read,write)
The enabled state of ScrollBar.

height

height:Number
(write)
Deprecated Use setHeight.

snapping

snapping
(write)
The number of pixels to snap to.

target

target:IScrollable
(write)
Deprecated Use setTarget.

Instance methods

alignScroller

function alignScroller (
) : Void
Aligns the scroller to the position of the content

scroll

function scroll (
inDirection:Number) : Void
Programmatically scrolls the scrollbar.
Events broadcast to listeners:
ScrollEvent with type: ON_SCROLL_CONTENT

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