Creating Scrolling Text - MACROMEDIA FLASH 8-USING FLASH Use Manual

Using flash
Table of Contents

Advertisement

Creating scrolling text

You can use the
scroll
scrolling and the
hscroll
block. The
and
scroll
visible line in a text block; you can read and write these properties. The
properties contain a number that specifies the topmost visible line in a text block
maxhscroll
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
method. Assign the text field an instance name as a parameter of the
createTextField
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
5.
Replace
instanceName
6.
Increment the
scroll
myInstanceName.scroll += 1;
7.
Select the Down button on the Stage.
8.
Repeat steps 4 and 5.
9.
Decrement the
scroll
this:
myInstanceName.scroll -= 1;
and
properties of the TextField object to control vertical
maxscroll
and
maxhscroll
properties contain a number that specifies the topmost
hscroll
method.
property to add it to the Script pane.
with the instance name of the text field you want to scroll.
property by 1 to scroll the text up. The code should look like this:
property by 1 to scroll the text down. The code should look like
properties to control horizontal scrolling in a text
and
maxscroll
createTextField
Creating scrolling text
189

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents