Working with Text > Creating scrolling text

 

Creating scrolling text

There are several ways to create scrolling text in Flash. You can make dynamic text fields scrollable by selecting the Scrollable Mode option in the Text menu or the context menu, or by Shift-double-clicking the text block handle.

You can add the scrollbar component to a text field to make it scroll. For more information, see Using Components.

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 block. The scroll and hscroll properties contain a number that specifies the topmost visible line in a text block; you can read and write these properties. The maxscroll and maxhscroll properties contain a number that specifies the topmost visible line in a text block when the bottom line of the text is visible in the text block; you can only read these properties.

 
To create a scrollable dynamic text block, do one of the following:

Double-click the handle on the dynamic text block.

Select the dynamic text block with the Arrow tool and choose Text > Scrollable Text.

Select the dynamic text block with the Arrow tool. Right-click (Windows) or Control-click (Macintosh) the dynamic text block and choose Text > Scrollable Text.

 
To use the scroll property to create scrolling text:

1

Do one of the following:

Use the Text tool to drag a text field on the Stage. Assign the text field an instance name in the Property inspector.

Use ActionScript to create a text field dynamically with the createTextField method. Assign the text field an instance name as a parameter of the createTextField method.

2

Create an up button and a down button or choose Window > Common Libraries > Buttons and drag buttons to the Stage. You will use these buttons to scroll the text up and down.

3

Select the Up button on the Stage.

4

In the Actions panel, select the Objects category, then select the Movie category, then select the TextField category, then select the Properties category, then double-click the scroll property to add it to the Script pane.

5

In the Object parameter field, enter the instance name of the text field you want to scroll.

6

Increment the scroll property by 1 to scroll the text up. The code should look like this:

instName.scroll += 1;

7

Select the Down button on the Stage.

8

Repeat steps 4 and 5.

9

Decrement the scroll property by 1 to scroll the text down. The code should look like this:

instName.scroll -= 1;