User Guide

1389
55
CHAPTER 55
UIScrollBar Component
The UIScrollBar component allows you to add a scroll bar to a text field. You can add a scroll
bar to a text field while authoring, or at runtime with ActionScript.
The UIScrollBar component functions like any other scroll bar. It contains arrow buttons at
either end and a scroll track and scroll box (thumb) in between. It can be attached to any edge
of a text field and used both vertically and horizontally.
Using the UIScrollBar component
To use the UIScrollBar component, verify that object snapping is turned on (View >
Snapping > Snap to Objects). Then create a text input field on the Stage and drag the
UIScrollBar component from the Components panel to any quadrant of the text field’s
bounding box.
If the length of the scroll bar is smaller than the combined size of its scroll arrows, it is not
displayed correctly. One of the arrow buttons becomes hidden behind the other. Flash does
not provide error checking for this. In this case it is a good idea to hide the scroll bar with
ActionScript. If the scroll bar is sized so that there is not enough room for the scroll box
(thumb), Flash makes the scroll box invisible.
Unlike many other components, the UIScrollBar component can receive continuous mouse
input, such as when the user holds the mouse button down, rather than requiring
repeated clicks.
There is no keyboard interaction with the UIScrollBar component.