User Guide

356 Handling Events
Stopping event flow
You can call either the Event.stopPropogation() method or the
Event.stopImmediatePropogation() method to prevent an event object from continuing
on its way through the event flow. The two methods are nearly identical and differ only in
whether the current node's other event listeners are allowed to execute:
The Event.stopPropogation() method prevents the event object from moving on to
the next node, but only after any other event listeners on the current node are allowed to
execute.
The Event.stopImmediatePropogation() method also prevents the event object from
moving on to the next node, but does not allow any other event listeners on the current
node to execute.
Calling either of these methods has no effect on whether the default behavior associated with
an event occurs. Use the default behavior methods of the Event class to prevent default
behavior.
Cancelling default event behavior
The two methods that pertain to cancelling default behavior are the preventDefault()
method and the
isDefaultPrevented() method. Call the preventDefault() method to
cancel the default behavior associated with an event. To check whether
preventDefault()
has already been called on an event object, call the
isDefaultPrevented() method, which
returns a value of
true if the method has already been called and false otherwise.
The
preventDefault() method will work only if the event's default behavior can be
cancelled. You can check whether this is the case by referring to the API documentation for
that event type, or by using ActionScript to examine the
cancelable property of the event
object.
Cancelling the default behavior has no effect on the progress of an event object through the
event flow. Use the event flow methods of the Event class to remove an event object from the
event flow.