Chapter 27. Text Display and Input

Flash Player offers an extensive, sophisticated API for working with text. In this chapter we’ll look at some of its key features: creating and displaying text, formatting text, and handling text input.

The information presented in this chapter applies specifically to Flash Player (both the browser add-on and standalone versions) but is also generally applicable to any Flash runtime that supports full-featured text display and input, such as Adobe AIR. Note, however, that unlike Flash Player, Adobe AIR provides full-featured HTML and CSS support, analogous to that found in web browsers such as Microsoft Internet Explorer and Mozilla Firefox. When working with other Flash runtimes, be sure to consult the appropriate documentation for information on text support.

The centerpiece of Flash Player’s text API is the TextField class, which provides control over text displayed on screen.

Tip

In this book (and in most ActionScript documentation), the term “text field,” refers, in a general sense, to a given text field on screen and its corresponding ActionScript TextField instance. Meanwhile, the phrase “a TextField object” refers more specifically to the ActionScript object that controls a text field.

Before we start creating and working with text, let’s take a quick look at the core classes in Flash Player’s text API, listed in Table 27-1. The text API’s feature set can be broken into the following general categories:

  • Controlling on-screen text

  • Formatting text ...

Get Essential ActionScript 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.