MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 427

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Applying styles to a TextField object
To apply a style sheet object to a TextField object, you assign the style sheet object to the text
field's
property.
styleSheet
textObj_txt.styleSheet = styles;
Do not confuse the
The capitalization indicates the difference.
When you assign a style sheet object to a TextField object, the following changes occur to the
text field's normal behavior:
The text field's
text
field, always contain the same value and behave identically.
The text field becomes read-only and cannot be edited by the user.
The
setTextFormat()
function with the text field. The only way to change the field is by altering the text field's
or
text
htmlText
Any text assigned to the text field's
variable is stored verbatim; anything written to one of these properties can be retrieved in
the text's original form.
Applying a style sheet to a TextArea component
To apply a style sheet to a TextArea component, you create a style sheet object and assign it
HTML styles using the TextField.StyleSheet class. You then assign the style sheet to the
TextArea component's
The following examples create a style sheet object,
component instance.
Using a style sheet with a TextArea component:
1.
Create a new Flash document and save it as textareastyle.fla.
2.
Drag a TextArea component from the User Interface folder of the Components panel to
the Stage and give it an instance name of myTextArea.
TextField.styleSheet
and
properties, and any variable associated with the text
htmlText
and
replaceSel()
property or by changing the text field's associated variable.
text
property.
styleSheet
Formatting text with Cascading Style Sheet styles
property with the TextField.StyleSheet class.
methods of the TextField class no longer
property,
property, or associated
htmlText
, and assign it to the
styles
myTextArea
427

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