Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Working with text and working with the keyboard are skills that all Flash programmers need in their virtual tool belts. In this chapter, you’ll learn how to use ActionScript to work with text fields, format them, and then respond to events from the keyboard. Working with text and the keyboard requires a high level of precision and accuracy. To help decipher all of this, you will use an interactive quiz to display ActionScript-based text and control the selection of answers through the keyboard.
Before you learn how to work with keyboard events, let’s cover the basics of working with text fields with ActionScript. The example for using the keyboard will be with a simple quiz where you’ll ask a question and the user must press the button on the keyboard that corresponds to the answer. The text that displays in the quiz will be created entirely with ActionScript, without placing any text fields visually on the Stage in Flash Professional CS5.5.