Creating Scrolling Text - MACROMEDIA FLASH MX 2004-USING FLASH Use Manual

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

You can capture the following text field events:
To use a text field event to trigger a script:
Assign an instance name to the text field. Do one of the following:
1.
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
Assign the text field an instance name as a parameter of the
In the Actions panel, select the Built-in Classes category in the Actions toolbox, then select the
2.
Movie category, then select the TextField category, and then select the Events category. Finally,
double-click an event. For this example, use the
Replace the placeholder
3.
Add ActionScript statements inside the function. These statements run when the text field
4.
is changed.
About using Cascading Style Sheets (CSS) with text fields
You can attach style sheets to text fields to control text formatting. Flash supports a subset of CSS
tags. You attach a style sheet to a text file using the TextField.StyleSheet object. See "Creating a
style sheet object" in Using ActionScript in Flash.

Creating scrolling text

You can use the
scrolling and the
block. The
scroll
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 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:
Assign an instance name to the text field that will contain scrolling text. Do one of the following:
1.
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
Assign the text field an instance name as a parameter of the
Create an Up button and a Down button or select Window > Other Panels > Common
2.
Libraries > Buttons and drag buttons to the Stage. You will use these buttons to scroll the text
up and down.
Select the Up button on the Stage.
3.
In the Actions panel, select the Built-in Classes category, then select the Movie category, then
4.
select the TextField category, and then select the Properties category. Finally, double-click the
property to add it to the Script pane.
scroll
128
Chapter 6: Working with Text
instanceName
and
scroll
maxscroll
and
hscroll
maxhscroll
and
properties contain a number that specifies the topmost visible
hscroll
and
onChanged
onChanged
with the actual instance name of the text field
properties of the TextField object to control vertical
properties to control horizontal scrolling in a text
.
onScroller
method.
createTextField
method.
createTextField
method.
and
maxscroll
maxhscroll
method.
createTextField
method.
createTextField
.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents