User Guide
flash.events package 339
In ActionScript 2.0, nearly all visual elements were controlled by the MovieClip class or
handled “behind the scenes” by Flash Player. Low-level control of objects was not available. In
ActionScript 3.0, the API to control visual elements is defined more logically, by functionality
and usage. The flash.display package includes the following classes:
■ Basic building blocks that inherit from the DisplayObject class, such as
DisplayObjectContainer and Sprite. MovieClip, also a basic building block, is used for
objects that require a timeline. Functionality specific to buttons, such as properties for
various button states, is contained in the SimpleButton class.
■ Classes used to create expressive graphics, such as Graphics and Shape for vector graphics
and Bitmap and BitmapData for bitmap images.
■ Classes for timeline-based applications and animation, such as MovieClip and Scene.
■ The Loader and LoaderInfo class, which handle loading of SWF files or image files (JPG,
PNG, or GIF).
■ Additional classes to support the classes just listed.
For more information, see “Display Programming” on page 159 and the flash.display package
in the ActionScript 3.0 Language Reference.
flash.errors package
The flash.errors package contains error classes that relate to Flash Player-specific functionality,
such as IOError (input/out error) and IllegalOperationError. In ActionScript 3.0, exceptions
are the primary mechanism for reporting run-time errors. For more information, see
“Handling Errors” on page 255 and the flash.errors package in the ActionScript 3.0 Language
Reference.
flash.events package
The flash.events package supports the new XML Document Object Model (DOM) event
model and includes the EventDispatcher base class. Events include error events. Error events
are used when errors are encountered during an asynchronous operation, such as a call to the
Loader.load() method. For more information, see “Handling Events” on page 345 and the
flash.events package in the ActionScript 3.0 Language Reference.