Constructors

Properties

Methods

AxisScroller class

AxisScroller

 

 

 

Overview

Author

Matt Przybylski [http://www.reintroducing.com]

Version

1.0

Description

Creates a scroller that allows for scrolling in the x or y axis, using the mouse wheel/arrow keys, different easing functions and types, and some other miscellaneous cool things.

Constructors

 

AxisScroller

Usage

public function AxisScroller($stage:Stage, $holder:MovieClip, $scroller:MovieClip, $toBeScrolled:MovieClip, $track:MovieClip, $mask:MovieClip, $axis:String, $optionalParams:Object):void

Description

Creates a new instance of the AxisScroller class.

The $optionalParams parameter takes in a couple of values.

  • scrollType: A string representing the scroll type, "instant" or "easing" (default: "easing")
  • isTrackClickable: A boolean value that makes the track clickable so that you can scroll directly to a certain spot (default: true)
  • useArrows: A boolean value that allows the use of arrow buttons (default: false)
  • upArrow: If useArrows, a movie clip that represents the up arrow button (default: null)
  • downArrow: If useArrows, a movie clip that represents the down arrow button (default: null)
  • continuousScroll: If useArrows, a boolean that specifies if when pressing the arrows the scrolling should happen continuously or not (default: false)
  • easeFunc: A function representing the ease type you'd like to use, as per the Tween class easing functions (default: Regular.easeOut)
  • duration: An integer (in seconds) representing the time that the scrollable content will take to move when easing is used (default: .25)
  • arrowMove: An integer (in pixels) that the scrollable content will move onMouseWheel/Key/Arrow movement (default: 100)
  • autoHideControls: A boolean value that hides the scroller/track/arrows (if applicable) if the scroll content is too small to scroll (default: false)
  • scaleScroller *: A boolean value that allows automatic scaling of the scroll bar (default: false)
If you use the scaleScroller optional parameter, please make the size of the scroll bar the same size as the track and this will take care of scaling it automatically for you. If you AREN'T using this parameter, please size your scroll bar accordingly manually.

Parameters

$stage
The stage object to use for keyboard input
$holder
The movie clip (or timeline) that holds all of the other clips corresponding to the scroller
$scroller
The movie clip to be used as the scroller
$toBeScrolled
The movie clip where the scrollable content resides
$track
The movie clip that is used as the track (measures extremes)
$mask
The movie clip that is used as the mask for the scrollable content area
$axis
A string value of either "x" or "y" that determines what axis the content is scrolled along
$optionalParams
Optional parameters to further control the scroller

Properties

 

autoHideControls

Usage

trace(scroller.autoHideControls);

scroller.autoHideControls = true;

Description

Gets the value of autoHideControls to see if they are currently being hidden or not.Sets the value of autoHideControls "on-the-fly".

Methods

 

create

Usage

public function create():void

Description

Creates the scroller again if it was deleted using destroy.

Returns

void
 

reset

Usage

public function reset():void

Description

Resets the position of the scroller and the content movie clip to its initial position.

Returns

void
 

destroy

Usage

public function destroy():void

Description

Performs garbage collection of events.

Returns

void