Example
The following example scrolls the text field to the beginning of the text it contains:
myScrollBar.scrollPosition = 0;
The following example scrolls the text field to the end of the text it contains:
myScrollBar.scrollPosition = myTextField.maxscroll - 1;
UIScrollBar.setScrollProperties()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
scrollBarInstance.setScrollProperties(pageSize, minPos, maxPos)
Parameters
The number of items that can be viewed in the display area. This parameter sets the
pageSize
size of the text field's bounding box. If the scroll bar is vertical, this value is a number of lines of
text; if the scroll bar is horizontal, this value is a number of pixels.
This parameter refers to the lowest numbered line of text when the scroll bar is used
minPos
vertically, or the lowest numbered pixel in the text field's bounding box when the scroll bar is used
horizontally. The value is usually 0.
This value refers to the highest numbered line of text when the scroll bar is used
maxPos
vertically, or the highest numbered pixel in the text field's bounding box when the scroll bar is
used horizontally.
Description
Method; sets the scroll range of the scroll bar and the size of the text field that the scroll bar is
attached to. This method is primarily useful when you attach a UIScrollBar component to a text
field at runtime (using
The
and
minPos
scroll range for the scroll bar and the associated text field.
If you use the
replaceText
setScrollProperties()
Example
The following example sets up a UIScrollBar component to display 10 lines of text at a time in
the text field out of a range of 0 to 99 lines:
myScrollBar.setScrollProperties(10, 0, 99);
840
Chapter 6: Components Dictionary
UIScrollBar.setScrollTarget()
values are used together by the UIScrollBar component to determine the
maxPos
method to set the text of the text field, you must use
to cause an update of the scroll bars.
) rather than while authoring.
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?