Events in ActionScript 3.0

An event allows a given course of action to be replaced by a different course of action. Events contribute in a major way to making interactive media as interesting as they are. AS3.0 has quite an involved event framework. We won't go into details of the event framework and how it works under the hood, but will just take a very practical approach by simply reviewing the code syntax for tracking and responding to events. Also we focus here only on a few examples that we'll use frequently in our physics applications.

Event listeners and handlers

There are two aspects to event management: tracking events and responding to events. In AS3.0, event listeners “listen” to events, and event handlers take the appropriate action. ...

Get The Essential Guide to Physics for Flash Games, Animation, and Simulations 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.