150
Chapter 8: Working with Text
List item tag (<li>)
The
<li>
tag places a bullet in front of the text that it encloses.
Grocery list:
<li>Apples</li>
<li>Oranges</li>
<li>Lemons</li>
The above code would render as follows:
Grocery list:
■
Apples
■
Oranges
■
Lemons
Paragraph tag (<p>)
The
<p>
tag creates a new paragraph. It supports the following attributes:
•
align
Specifies alignment of text within the paragraph; valid values are
left
,
right
,
and
center
.
•
class
Specifies a CSS style class defined by an TextField.StyleSheet object. (For more
information, see
“Using style classes” on page 143
.)
The following example uses the
align
attribute to align text on the right side of a text field.
textField.htmlText = "<p align='right'>This text is aligned on the right
side of the text field</p>";
The following example uses the
class
attribute to assign a text style class to a
<p>
tag.
var myStyleSheet = new TextField.StyleSheet();
myStyleSheet.secreateTextField("test", 10, 0,0, 300,100);
createTextField("test", 10, 0,0, 300,100);
test.styleSheet = myStyleSheet;
test.htmlText = "<p class='body'>This is some body-styled text.</p>.";
Span tag (<span>)
The
<span>
tag is available only for use with CSS text styles. (For more information, see
“Formatting text with Cascading Style Sheets” on page 139
.) It supports the following attribute:
•
class
Specifies a CSS style class defined by an TextField.StyleSheet object. For more
information on creating text style classes, see
“Using style classes” on page 143
.
Text format tag (<textformat>)
The
<textformat>
tag lets you use a subset of paragraph formatting properties of the TextFormat
class within HTML text fields, including line leading, indentation, margins, and tab stops. You
can combine
<textformat>
tags with the built-in HTML tags.
The
<textformat>
tag has the following attributes:
•
blockindent
Specifies the block indentation in points; corresponds to
TextFormat.blockIndent
. (See
TextFormat.blockIndent
on page 718
.)
•
indent
Specifies the indentation from the left margin to the first character in the paragraph;
corresponds to
TextFormat.indent
. (See
TextFormat.indent
on page 722
.)
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...