About Strings And The String Class - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

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 the instance
name textField_txt in the Property inspector.
Use ActionScript to create a text field dynamically with the
MovieClip.createTextField()
textField_txt as a parameter of the method.
If you are not dynamically loading text into the SWF file, select Text > Scrollable
from the main menu.
2.
Create an Up button and a Down button, or select 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 Down button on the Stage and type down_btn into the Instance Name text box.
4.
Select the Up button on the Stage and type up_btn into the Instance Name text box.
5.
Select Frame 1 on the Timeline, and, in the Actions panel (Window > Actions), enter the
following code to scroll the text down in the text field:
down_btn.onPress = function() {
textField_txt.scroll += 1;
};
6.
Following the ActionScript in step 5, enter the following code to scroll the text up:
up_btn.onPress = function() {
textField_txt.scroll -= 1;
};
Any text that loads into the
down buttons.

About strings and the String class

In programming, a string is an ordered series of characters. You use strings often in your Flash
documents and class files to display text in applications, such as within text fields. Also, you
can store values as strings that you can use in an application for a variety of purposes. You can
put strings directly in your ActionScript code by placing quotation marks around the
characters of data. For more information on creating strings, see
on page
458. For information on using text fields, see
on page
384.
450
Working with Text and Strings
method. Assign the text field the instance name
text field can be scrolled using the up and
textField_txt
"Creating strings"
"Using the TextField class"

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents