User Guide

44 Working with Text and Fonts
9. To use the application, press the emulator’s select key to open the text input dialog box and
enter some text using your computer’s keyboard. Then click OK to close the dialog box.
The text that you entered appears in the
messageTxt text field in italics.
Creating scrolling text
(Flash Professional only)
Flash Lite supports the TextField.scroll and TextField.maxscroll properties, which let
you create scrolling text fields. The
scroll property specifies the first visible line in a text
block; you can get and set its value. For example, the following code scrolls the text field
whose variable name is
story_text down by five lines:
story_text.scroll += 5;
The maxscroll property specifies the first visible line in a text block when the last line of the
text is visible in the text block; this property is read-only. You can compare a text field’s
maxscroll property to its scroll property to determine how far a user has scrolled within a
text field. This is useful if you want to create a scroll bar that provides feedback about the
user’s current scroll position relative to the maximum scroll position.
To create a scrolling text field and control it with ActionScript:
1. In Flash, create a new document from the Flash Lite 2.0 Generic device template that you
created earlier. (See “Creating a Flash Lite document template (Flash Professional only)” in
Getting Started with Flash Lite 2.x).
2. Using the Text tool, drag a text field approximately the size shown in the following image
on the Stage:
3. Select Multiline from the Line Type pop-up menu in the Property inspector.
4. Select Dynamic Text from the Text Type pop-up menu in the Property inspector.