User Guide
1400 UIScrollBar Component
UIScrollBar.horizontal
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
scrollBarInstance.horizontal
Description
Property; indicates whether the scroll bar is oriented vertically (false) or horizontally (true).
This property can be tested and set. The default value is
false.
Example
The following example uses the horizontal property to set the scroll bar named my_sb to a
horizontal orientation and displays the text in the TextField component
my_txt:
/**
Requires:
- UIScrollBar component in library
*/
// Create the text field.
this.createTextField("my_txt", 10, 10, 20, 200, 100);
my_txt.wordWrap = false;
my_txt.text = "Mary had a little lamb whose fleece " +
"was white as snow and everywhere that Mary went the " +
"lamb was sure to go."
// Create scroll bar.
this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
my_sb.horizontal = true;
// Set the target text field for the scroll bar.
my_sb.setScrollTarget(my_txt);
// Size it to match the text field.
my_sb.setSize(my_txt._width, 16);
// Move it to the bottom of the text field.
my_sb.move(my_txt._x, my_txt._y + my_txt._height);