Using The Textfield Class - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

In Flash Player 7 and later, you can apply Cascading Style Sheet (CSS) styles to text fields
using the TextField.StyleSheet class. You can use CSS styles to style built-in HTML tags,
define new formatting tags, or apply styles. For more information on using CSS, see
"Formatting text with Cascading Style Sheet styles" on page
You can also assign HTML formatted text, which might optionally use CSS styles, directly to
a text field. In Flash Player 7 and later, HTML text that you assign to a text field can contain
embedded media (movie clips, SWF files, and JPEG files). In Flash Player 8, you can also
dynamically load PNG, GIF, and progressive JPEG images (Flash Player 7 does not support
progressive JPEG images). The text wraps around the embedded media similar to how a web
browser wraps text around media embedded in an HTML document. For more information,
see
"Image tag" on page
For information on the terminology that compares text, strings, and more, see the
introduction for this chapter,

Using the TextField class

The TextField class represents any dynamic or input (editable) text field you create using the
Text tool in Flash. You use the methods and properties of this class to control text fields at
runtime. TextField objects support the same properties as MovieClip objects, with the
exception of the
_currentframe
properties. You can get and set properties and invoke methods for text fields dynamically.
To use ActionScript to control a dynamic or input text field, you must assign the text field an
instance name in the Property inspector. You can then reference the text field with the
instance name, and use the methods and properties of the TextField class to control the
contents or basic appearance of the text field.
You can also create TextField objects at runtime, and assign them instance names, using the
MovieClip.createTextField()
runtime" on page
387.
For more information on using the TextField class, see the following topics:
"Assigning text to a text field at runtime" on page 385
"About text field instance and variable names" on page 386
You can find sample source files that demonstrate how to work with text fields using
ActionScript. The source files are called textfieldsA.fla and textfieldsB.fla, and you can find
them in the Samples folder on your hard disk:
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\TextFields.
384
Working with Text and Strings
439.
"Working with Text and Strings" on page
,
_droptarget
method. For more information, see
421.
,
, and
_framesloaded
381.
_totalframes
"Creating text fields at

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents