Class com.maheshj.UI.ScrollBar

Description

This class can be used as a generic slider in your applications, may be as a voulme slider, a scrollbar or any other case where you have to use a slider. The following events are dispatched by this class:

Scrolling - This event keeps on firing from the moment the scrollface is pressed to the moment the scrollface is released. The event object has the following properties:
position - A number ranging from 1 to 100 that tells where the position of the scrollface is.

Scrolled - This event is fired once the scrollface is released after the scrolling is done, or when the scroll or scrollTo functions are called. The event object has the following properties:
position - A number ranging from 1 to 100 that tells where the position of the scrollface is.

Usage: In the movieclip you want to use as a scrollbar, create two movie clips with instance names face_mc and base_mc. Align the face_mc and base_mc movieclips properly. Then in the library, right-click on the movieclip that you want to use as scrollbar, and select Linkage. In the Class: field, write com.maheshj.UI.scroller.ScrollBar and click OK. Make sure that the com directory in which the scrollbar classes are provided are available in the FLA's classpaths.

Field Index

faceHeight, scrollHeight

Method Index

addEventListener(), removeEventListener(), scroll(), scrollTo()

Field Detail

scrollHeight

public scrollHeight:Number
Use this property to get and set the height of the scrollbase.

faceHeight

public faceHeight:Number
Use this property to get and set the height of the scrollface.

Method Detail

scroll

public function scroll(num:Number)

If you want to implement a custom scroll, i.e., want to scroll the scrollbar by a certain amount from outside the scrollbar without using the scrollface, then you can use this method.

Parameters

num- a parameter of type Number that denotes the amount by which it is to be scrolled.

scrollTo

public function scrollTo(num:Number)

If you want to implement a custom scroll, i.e., want to scroll the scrollbar to a certain position from outside the scrollbar without pressing the scrollface, then you can use this method.

Parameters

num- a parameter of type Number that denotes the position to which it is to be scrolled.

addEventListener

public function addEventListener()

removeEventListener

public function removeEventListener()