F > FScrollBar (component) |  |

FScrollBar (component)

FScrollBar, component

The ScrollBar component in the Flash authoring environment provides drag-and-drop functionality for adding scroll bars to dynamic and input text fields in Flash documents; it also provides a user interface for setting basic parameters. The methods of the FScrollBar component allow you to control scroll bars at runtime: you can create scroll bars, control scroll bars created in authoring, set or override basic parameters, and set additional runtime options. You do not need to use a constructor to access the methods of components. Some of the methods of the FScrollBar component are not recommended for use with scroll bars attached to text fields. See individual method entries for details.

Advanced users and programmers can use the ScrollBar component with other Flash elements to create custom user interfaces.

Component methods do not perform error checking for type, as do other native ActionScript objects and actions; therefore, it is recommended that you validate parameters before passing them to methods.

The ScrollBar component is supported by Flash Player 6 and later versions of the Flash Player.

For information on using the ScrollBar component, setting parameters during authoring, and changing the color and appearance of components, see Customizing component colors and textand Customizing component skins in the Using Components chapter in Using Flash.

Method summary for the FScrollBar component

Method | Description
--- | ---
`FScrollBar.getEnabled` | Returns `true` if the scroll bar is enabled, `false` if it is disabled.
`FScrollBar.getScrollPosition` | Returns an integer representing the current position of the scroll box (thumb).
`FScrollBar.registerSkinElement` | Registers a skin element to a property defined for a skin in the Read Me layer located on Frame 1 of a skin movie clip in the library.
`FScrollBar.setChangeHandler` | Specifies a function to call every time the scroll position changes. (You cannot use this method with text fields.)
`FScrollBar.setEnabled` | Specifies whether the scroll bar is enabled (`true`) or disabled (`false`).
`FScrollBar.setHorizontal` | Specifies whether the scroll bar is horizontal (`true`) or vertical (`false`).
`FScrollBar.setLargeScroll` | Specifies the number of positions scrolled when the user clicks the track.
FScrollBar.setScrollContent | Specifies the text field instance to which the scroll bar applies.
`FScrollBar.setScrollPosition` | Sets the position of the scroll box as an integer between `minPos` and `maxPos`.
`FScrollBar.setScrollProperties` | Sets the `pageSize`, `minPos`, and `maxPos` properties for the scroll bar. (You cannot use this method with text fields.)
`FScrollBar.setScrollTarget` | Specifies a text field as the target for the scroll bar.
`FScrollBar.setSize` | Sets the length of the scroll bar, in pixels.
`FScrollBar.setSmallScroll` | Specifies the number of positions scrolled when the user clicks a scroll arrow.
`FScrollBar.setStyleProperty` | Sets a single style property for a component.