User Guide
1406 UIScrollBar Component
UIScrollBar.scrollPosition
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
scrollBarInstance.scrollPosition
Description
Property; gets or sets the current scroll position of the scroll box (thumb) when a new
scrollPosition value is set. The value of scrollPosition depends on whether the
UIScrollBar instance is being used for vertical or horizontal scrolling.
Set the scrolling of the scroll bar target instance separately, using the following syntax:
my_scrollbar._targetInstanceName.scroll = 20;
If the UIScrollBar instance is being used for vertical scrolling (the most common use), the
value of
scrollPosition is an integer with a range that begins with 0 and ends with a
number that is equal to the total number of lines in the text field divided by the number of
lines that can be displayed in the text field simultaneously. If
scrollPosition is set to a
number greater than this range, the text field simply scrolls to the end of the text.
To set the scroll box (thumb) to the first line, set
scrollPosition to 0.
To set the scroll box (thumb) to the end, set
scrollPosition to the number of lines of text
in the text field minus 1. You can determine the number of lines by retrieving the value of the
maxscroll property of the text field.
If the UIScrollBar instance is being used for horizontal scrolling, the value of
scrollPosition is an integer value ranging from 0 to the width of the text field, in pixels.
You can determine the width of the text field in pixels by getting the value of the
maxhscroll
property of the text field.
The default value of
scrollPosition is 0.