ScrollPane class

Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView > ScrollPane

ActionScript Class Name mx.containers.ScrollPane

The properties of the ScrollPane class let you do the following at runtime: set the content, monitor the loading progress, and adjust the scroll amount.

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

You can set up a scroll pane so that users can drag the content within the pane. To do this, set 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 available only on the class itself. The version property returns a string that indicates the version of the component. To access this property, use the following code:

trace(mx.containers.ScrollPane.version);

NOTE

 

The code trace(myScrollPaneInstance.version); returns undefined.

Method summary for the ScrollPane class

The following table lists methods of the ScrollPane class.

Method

Description

ScrollPane.getBytesLoaded()

Returns the number of bytes of content loaded.

ScrollPane.getBytesTotal()

Returns the total number of bytes of content to be loaded.

ScrollPane.refreshPane()

Reloads the contents of the scroll pane (but does not redraw the scroll bar).

Methods inherited from the UIObject class

The following table lists the methods the ScrollPane class inherits from the UIObject class. When calling these methods from the ScrollPane object, use the form ScrollPaneInstance.methodName.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from the UIComponent class

The following table lists the methods the ScrollPane class inherits from the UIComponent class. When calling these methods from the ScrollPane object, use the form ScrollPaneInstance.methodName.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Property summary for the ScrollPane class

The following table lists properties of the ScrollPane class.

Method

Description

ScrollPane.content

A reference to the content loaded into the scroll pane (read-only).

ScrollPane.contentPath

A string that indicates an absolute or relative URL of the SWF or JPEG file to load into the scroll pane, or that is the linkage identifier of a movie clip in the current document's library panel.

ScrollPane.hLineScrollSize

The amount of content to scroll horizontally when a scroll arrow is clicked.

ScrollPane.hPageScrollSize

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

ScrollPane.hPosition

The horizontal pixel position of the scroll pane's horizontal scroll bar.

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 scrolling occurs (true) or not (false) when a user drags on content within the scroll pane. The default value is false.

ScrollPane.vLineScrollSize

The amount of content to scroll vertically when a scroll arrow is clicked.

ScrollPane.vPageScrollSize

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

ScrollPane.vPosition

The pixel position of the scroll pane's vertical scroll bar.

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".

Properties inherited from the UIObject class

The following table lists the properties the ScrollPane class inherits from the UIObject class. When accessing these properties from the ScrollPane object, use the form ScrollPaneInstance.propertyName.

Property

Description

UIObject.bottom

Read-only; the position of the bottom edge of the object, relative to the bottom edge of its parent.

UIObject.height

Read-only; the height of the object, in pixels.

UIObject.left

Read-only; the left edge of the object, in pixels.

UIObject.right

Read-only; the position of the right edge of the object, relative to the right edge of its parent.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

Read-only; the position of the top edge of the object, relative to its parent.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

Read-only; the width of the object, in pixels.

UIObject.x

Read-only; the left edge of the object, in pixels.

UIObject.y

Read-only; the top edge of the object, in pixels.

Properties inherited from the UIComponent class

The following table lists the properties the ScrollPane class inherits from the UIComponent class. When accessing these properties from the ScrollPane object, use the form ScrollPaneInstance.propertyName.

Property

Description

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tab order for a component in a document.

Event summary for the ScrollPane class

The following table lists events of the ScrollPane class.

Event

Description

ScrollPane.complete

Broadcast when the scroll pane content is loaded.

ScrollPane.progress

Broadcast while the scroll pane content is loading.

ScrollPane.scroll

Broadcast when the scroll bar is clicked.

Events inherited from the UIObject class

The following table lists the events the ScrollPane class inherits from the UIObject class.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

The following table lists the events the ScrollPane class inherits from the UIComponent class.

Event

Description

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00003977.html