Event Objects - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

To find out how a particular event type behaves, you can either check the API documentation
or examine the event object's properties. Examining the event object's properties is described
in the following section.

Event objects

Event objects serve two main purposes in the new event handling system. First, event objects
represent actual events by storing information about specific events in a set of properties.
Second, event objects contain a set of methods that allow you to manipulate event objects and
affect the behavior of the event handling system.
To facilitate access to these properties and methods, the Flash Player API defines an Event
class that serves as the base class for all event objects. The Event class defines a fundamental set
of properties and methods that are common to all event objects.
This section begins with a discussion of the Event class properties, continues with a
description of the Event class methods, and concludes with an explanation of why subclasses
of the Event class exist.
Understanding Event class properties
The Event class defines a number of read-only properties and constants that provide
important information about an event object.The following are especially important:
Event object types are represented by constants and stored in the
Whether an event's default behavior can be prevented is represented by a Boolean value
and stored in the
Event flow information is contained in the remaining properties.
Event object types
Every event object has an associated event type. Event types are stored in the
property as string values. It is useful to know the type of an event object so that your code can
distinguish objects of different types from one another. For example, the following code
specifies that the
clickHandler()
objects that are passed to
myDisplayObject.addEventListener(MouseEvent.CLICK, clickHandler);
352
Handling Events
property.
Event.cancelable
listener function should respond to any mouse click event
myDisplayObject
:
property.
Event.type
Event.type

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents