Creating scrolling text
189
Creating scrolling text
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 use the scroll property to create scrolling text:
1.
Assign an instance name to the text field that will contain scrolling text. Do one of the
following:
■
Use the Text tool to create 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 select Window > Common Libraries > Buttons
and drag the buttons to the Stage. You 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 Built-in Classes category, then select the Movie category,
then select the TextField category, and then select the Properties category. Finally, double-
click the
scroll
property to add it to the Script pane.
5.
Replace
instanceName
with 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:
myInstanceName
.= 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:
myInstanceName
.scroll -= 1;
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...