Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Text and Strings > Example: Creating scrolling text | |||
You can use several methods to create scrolling text in Flash. You can make dynamic and input text fields scrollable by selecting the Scrollable option from the Text menu or the context menu, or by pressing Shift and double-clicking the text field handle.
You can use the scroll and maxscroll properties of the TextField object to control vertical scrolling and the hscroll and maxhscroll properties to control horizontal scrolling in a text field. The scroll and hscroll properties specify the current vertical and horizontal scrolling positions, respectively; you can read and write these properties. The maxscroll and maxhscroll properties specify the maximum vertical and horizontal scrolling positions, respectively; you can only read these properties.
The TextArea component provides an easy way to create scrolling text fields with a minimum amount of scripting. For more information, see "TextArea component" in the ActionScript 2.0 Components Language Reference.
Do one of the following:
MovieClip.createTextField() method. Assign the text field the instance name textField_txt as a parameter of the method. |
NOTE |
|
If you are not dynamically loading text into the SWF file, select Text > Scrollable from the main menu. |
You will use these buttons to scroll the text up and down.
down_btn.onPress = function() {
textField_txt.scroll += 1;
};
up_btn.onPress = function() {
textField_txt.scroll -= 1;
};
Any text that loads into the textField_txt text field can be scrolled using the up and down buttons.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000941.html