Recipe 15.6. Working with Font and Text StylesProblemYou want to apply styles to components that affect the text and font. SolutionUse predefined styles in Flash to change aspects of the text. DescriptionFlash uses text in many different ways throughout the components. For example, text appears on buttons, as labels next to check boxes and radio buttons, and it is used to populate combo boxes and lists. But regardless of how Flash uses the text within a specific component, you can use the same group of styles. The styles are as follows:
For example, if you want to globally make the text in the components red using the _typewriter font group, you can use the following code: _global. style.setStyle("color", "red"); _global.style.setStyle("fontFamily", "_typewriter"); If you want to use an embedded font, make sure you've done the following:
You can embed a font in your .swf file either by adding a dynamic text field instance off the stage in which you've embedded the font or by using a font symbol. Both techniques are discussed in more detail in Recipe 8.14. |
Tripod >> 3pod Tips & Learning and manuals for educations