ScrollPane class

Inheritance UIObject > UIComponent > View > ScrollView > ScrollPane

ActionScript Class Namespace mx.containers.ScrollPane

The properties of the ScrollPane class allow you to set the content, monitor the loading progress, and adjust the scroll amount at runtime.

Setting a property of the ScrollPane class with ActionScript overrides the parameter of the same name set in the Property inspector or Component Inspector panel.

You can set up a scroll pane to allow users to drag the content within the pane by setting the scrollDrag property to true; a pointing hand appears on the content. Unlike most other components, events are broadcast when the mouse button is pressed and continue broadcasting until the button is released. If the contents of a scroll pane have valid tab stops, you must set scrollDrag to false otherwise each mouse interaction with the contents will invoke scroll dragging.

Each component class has a version property which is a class property. Class properties are only available on the class itself. The version property returns a string that indicates the version of the component. To access the version property, use the following code:

trace(mx.containers.ScrollPane.version);

Note: The following code returns undefined: trace(myScrollPaneInstance.version);.

Method summary for the ScrollPane class

Method

Description

ScrollPane.getBytesLoaded()

Returns the number of bytes of content loaded.

ScrollPane.getBytesTotal()

Returns the total number of content bytes to be loaded.

ScrollPane.refreshPane()

Reloads the contents of the scroll pane.

Inherits all methods from UIObject class and UIComponent class.

Property summary for the ScrollPane class

Method

Description

ScrollPane.content

A reference to the content loaded into the scroll pane.

ScrollPane.contentPath

An absolute or relative URL of the SWF or JPEG file to load into the scroll pane

ScrollPane.hLineScrollSize

The amount of content to scroll horizontally when an arrow button is pressed.

ScrollPane.hPageScrollSize

The amount of content to scroll horizontally when the track is pressed.

ScrollPane.hPosition

The horizontal pixel position of the scroll pane.

ScrollPane.hScrollPolicy

The status of the horizontal scroll bar. It can be always on ("on"), always off ("off"), or on when needed ("auto"). The default value is "auto".

ScrollPane.scrollDrag

Indicates whether there is scrolling when a user presses and drags within the ScrollPane (true) or not (false). The default value is false.

ScrollPane.vLineScrollSize

The amount of content to scroll vertically when an arrow button is pressed.

ScrollPane.vPageScrollSize

The amount of content to scroll vertically when the track is pressed.

ScrollPane.vPosition

The vertical pixel position of the scroll pane.

ScrollPane.vScrollPolicy

The status of the vertical scroll bar. It can be always on ("on"), always off ("off"), or on when needed ("auto"). The default value is "auto".

Inherits all properties from UIObject class and UIComponent class.

Event summary for the ScrollPane class

Method

Description

ScrollPane.complete

Broadcast when the scroll pane content is loaded.

ScrollPane.progress

Broadcast while the scroll bar content is loading.

ScrollPane.scroll

Broadcast when the scroll bar is pressed.

Inherits all events from UIObject class and UIComponent class.