• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Viewing and Entering Informat... > Using the Stylesheet Class

Using the Stylesheet Class

In previous examples in this chapter, the formatting has been done by using either the TextField or TextFormat properties. A new class in Flash MX 2004 is TextField.StyleSheet. Because the StyleSheet folder is a subfolder of the TextField class, it doesn't look like a separate class, but it is. TextField.StyleSheet has a single event: onLoad signals that the StyleSheet.load() operation is complete. Table 6.7 shows the methods of TextField.StyleSheet.

Table 6.7. TextField.StyleSheet Methods
METHODDESCRIPTION
clear()Clears the style sheet of all declarations
getStyle(sn)Gets the named style defined and its property names and values
getStyleNames()Gets the array containing the style names
load()Begins loading a CSS file into StyleSheet
parseCSS(cssSheet)Parses CSS in cssSheet and loads the style sheet
setStyle(name, style)Inserts a new style with name and the given characteristics (style)
transform(cssSelector)Transforms CSSselector into TextFormat



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint