This chapter will cover the basics of creating, formatting, and interacting with text fields and the text therein. Focusing on the mechanics of using text fields, rather than on string manipulations, this chapter will bring you up to speed with the essentials you need to add text to any project.
Flash uses three different kinds of text fields: static, dynamic, and input. The latter two types can be created and affected by ActionScript; they’re the focus of this chapter. Whenever you wish to exert ActionScript control over text, you turn to a dynamic text field. However, if you require user input, including anything from entering a user name and password to completing an essay, then you need to graduate to an input text field—essentially, dynamic fields with added user input features.
You’ll see in the first recipe of this chapter that you can very easily create a text field, and setting it to behave as a dynamic or input field is simply a matter of using a single property. This capability also means that you can switch between these two types, if the need arises.
The third text type, static, is accessible via ActionScript to a
very limited degree, but only the Flash interface can create static text
fields. You can retrieve text from a static text field, using the
TextSnapshot classes, but you must walk through the display list to find the desired field. Additionally, the Flash interface may break your text into multiple ...