10.3 Types of Events

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 10.  Events and Event Handling

Conceptually, events can be grouped into two categories:

user events

Actions taken by the user (e.g., a mouseclick or a keystroke)

system events

Things that happen as part of the internal playback of a movie (e.g., a movie clip appearing on stage or variables loading from an external file)

ActionScript does not distinguish syntactically between user events and system events. An event triggered internally by a movie is no less palpable than a user's mouseclick. While we might not normally think of, say, a movie clip's removal from the Stage as a noteworthy "event," being able to react to system events gives us great control over a movie.

ActionScript events can also be categorized more practically according to the object to which they pertain. All events happen relative to some object in the Flash environment. We'll study objects in depth in Chapter 12, but for now, simply assume that content in Flash (buttons, movie clips, text fields, etc) is normally represented as ActionScript objects and that we define events in relation to those objects.

The core ActionScript objects and classes that support events are:

  • Button

  • Key

  • LoadVars

  • LocalConnection

  • Mouse

  • MovieClip

  • Selection

  • SharedObject

  • Sound

  • Stage

  • TextField

  • XML

  • XMLSocket

For details on the specific events supported by these objects, see each object's entry in the Language Reference.

     



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net