UIScrollBar.setScrollTarget()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
scrollBarInstance.setScrollTarget(textInstance)
Parameters
The text field to assign to the scroll bar.
textInstance
Description
Method; assigns a UIScrollBar component to a text field instance. If you need to associate a
text field and a UIScrollBar component at runtime, use this method.
Example
The following example creates a scroll bar to scroll text in a text field, which it loads from a
web page. The example calls the
with the text field
my_sb
/**
Requires:
- UIScrollBar component in library
*/
this.createTextField("my_txt", 10, 10, 20, 200, 100);
my_txt.wordWrap = true;
this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
// Set the target text field.
my_sb.setScrollTarget(my_txt);
// Size it to match the text field.
my_sb.setSize(16, my_txt._height);
// Move it next to the text field.
my_sb.move(my_txt._x + my_txt._width, my_txt._y);
// Scroll 2 lines per click of scroll arrow.
my_sb.lineScrollSize = 2;
// Scroll 5 lines per click of scroll track.
setScrollTarget()
.
my_txt
method to associate the scroll bar
UIScrollBar.setScrollTarget() 1409
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?