Class ch.component.scrollbar.ScrollWheelButton

Implemented Interfaces

ScrollBarManager

Description

Manager of a ScrollBar, depending on the mouse wheel.

When an instance of this class is created, it automaticall register it to the Mouse events, using Mouse.addListener(this) into the constructor. If you want to unregister an instance from the Mouse events, just call the dispose() method.

Field Index

scrollValue

Method Index

new ScrollWheelButton()
getButton(), onMouseWheel(), setEnabled(), toString()

Inherited from AbstractScrollBarManager

Constructor Detail

ScrollWheelButton

public function ScrollWheelButton(button:MovieClip, scrollValue:Number)

Create a new ScrollWheelButton.

Note that if scrollValue is set to null, when the onMouseWheel event will be called, the delta will be used for the scroll.

Parameters

buttonThe clip to set as button.
scrollValueThe value to scroll or null.

Throws

ErrorIf button is null.

Field Detail

scrollValue

public scrollValue:Number
Scroll value.

Determine the speed of the scroll when the button is pressed.

If this value is null, then when the onMouseWheel() event will be called, the delta will be used as the scroll value.

Method Detail

getButton

public function getButton(Void):MovieClip

Get the button clip.

Return

The clip.

setEnabled

public function setEnabled(value:Boolean):Void

Set if the ScrollWheelButton is enabled or not.

When the ScrollWheelButton is enabled, it is registered within the Mouse.addListener method and it will receive the events dispatched by the mouse. If you set false, the Mouse.removeListener method will be called.

Parameters

value true to enable the ScrollWheelButton, false otherwise.

Overrides

setEnabled() in ch.component.scrollbar.AbstractScrollBarManager

onMouseWheel

public function onMouseWheel(delta:Number, target:MovieClip):Void

Manage the scroll.

This method is called by the Mouse when the onMouseWheel event is performed. Note that if scrollValue is null, the delta will be used as the scroll value.

Parameters

deltaA number indicating how many lines should be scrolled.
targetA parameter that indicates the topmost movie clip instance under the mouse pointer when the mouse wheel is rolled.

toString

public function toString(Void):String

Represent the current instance into a String.

Return

A String representing the ScrollWheelButton instance.

Overrides

toString() in ch.component.scrollbar.AbstractScrollBarManager