Skip to Main Content
Essential ActionScript 3.0
book

Essential ActionScript 3.0

by Colin Moock
June 2007
Intermediate to advanced content levelIntermediate to advanced
948 pages
27h 2m
English
O'Reilly Media, Inc.
Content preview from Essential ActionScript 3.0

Chapter 22. Interactivity

In this chapter, we’ll see how to add interactivity to an application by responding to Flash Player’s input events. Specifically, we’ll explore five different categories of input events:

  • Mouse events

  • Focus events

  • Keyboard events

  • Text events

  • Flash Player-level events

For each of the preceding event categories, we’ll consider the specific events offered by Flash Player’s API and the code required to handle those events.

The descriptions of the events covered in this chapter apply specifically to Flash Player (both the browser add-on and standalone versions) but are also generally applicable to any Flash runtime that supports mouse and keyboard input (such as Adobe AIR). When working with other Flash runtimes, be sure to consult the appropriate documentation for information on input events. For official reference material covering Flash Player’s input events, see Adobe’s ActionScript Language Reference under the Constants heading of the Event class and its subclasses. Also see the Events heading under the TextField, DisplayObject, InteractiveObject, and Stage classes.

Before we start our examination of specific input events, let’s take a quick look at some general rules that govern all input events:

InteractiveObject instances only

Input-event notifications are sent to instances of classes that inherit from InteractiveObject only (Sprite, TextField, Stage, Loader, MovieClip, SimpleButton and subclasses of those classes.) Other types of objects are not notified of input ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential ActionScript 2.0

Essential ActionScript 2.0

Colin Moock
The ActionScript 3.0 Quick Reference Guide

The ActionScript 3.0 Quick Reference Guide

Jen deHaan, David Stiller, Darren Richardson, Rich Shupe
ActionScript 3.0 Cookbook

ActionScript 3.0 Cookbook

Joey Lott, Darron Schall, Keith Peters

Publisher Resources

ISBN: 0596526946Errata