• Sep


    [AS3] Registering an Event Listener for an Event

    • Flash Platform
    • 发布:古树
    • 引用:0
    • 浏览:

    The general process for responding to an event in ActionScript 3.0 is as follows:

    1. Determine the name of the event's event-type.
    2. Determine the datatype of the event object representing the event.
    3. Create an event listener to respond to the event. The event listener must define a single parameter matching the datatype of the event object from Step 2.
    4. Use EventDispatcher class's instance method addEventListener() to register the event listener with the event target (or, any display ancestor of the event target).
    5. Sit back and wait for the event to occur.