Supported CSS properties
Flash Player supports a subset of properties in the original CSS1 specification
REC-CSS1). The following table shows the supported CSS properties and values, and their
corresponding ActionScript property names. (Each ActionScript property name is derived from
the corresponding CSS property name; the hyphen is omitted and the subsequent character
is capitalized.)
CSS property
text-align
font-size
text-decoration
margin-left
margin-right
font-weight
font-style
text-indent
font-family
color
display
Creating a style sheet object
CSS style sheets are represented in ActionScript by the
is only available for SWF files that target Flash Player 7 or later. To create a style sheet object, call
the TextField.StyleSheet class's constructor function.
var newStyle = new TextField.StyleSheet();
To add styles to a style sheet object, you can either load an external CSS file into the object, or
define the styles in ActionScript. See
styles with ActionScript" on page
140
Chapter 8: Working with Text
ActionScript property Usage and supported values
textAlign
fontSize
textDecoration
marginLeft
marginRight
fontWeight
fontStyle
textIndent
fontFamily
color
display
"Loading external CSS files" on page 141
142.
Recognized values are
Only the numeric part of the value is used; units (px, pt)
are not parsed; pixels and points are equivalent.
Recognized values are
Only the numeric part of the value is used. Units (px, pt)
are not parsed; pixels and points are equivalent.
Only the numeric part of the value is used. Units (px, pt)
are not parsed; pixels and points are equivalent.
Recognized values are
Recognized values are
Only the numeric part of the value is used. Units (px, pt)
are not parsed; pixels and points are equivalent.
A comma-separated list of fonts to use, in descending
order of desirability. Any font family name can be used.
If you specify a generic font name, it will be converted
to an appropriate device font. The following font
conversions are available:
,
_typewriter
sans-serif
is converted to
serif
_serif
Only hexadecimal color values are supported. Named
colors (like
) are not supported.
blue
Supported values are
inline
TextField.StyleSheet
(www.w3.org/TR/
,
, and
left
center
right
and
.
none
underline
and
.
normal
bold
and
.
normal
italic
is converted to
mono
is converted to
_sans
.
,
, and
.
block
none
class. This class
and
"Creating new
.
, and
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?