Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 356

Programming actionscript 3.0
Table of Contents

Advertisement

Stopping event flow
You can call either the
Event.stopImmediatePropogation()
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()
the next node, but only after any other event listeners on the current node are allowed to
execute.
The
Event.stopImmediatePropogation()
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
method and the
isDefaultPrevented()
cancel the default behavior associated with an event. To check whether
has already been called on an event object, call the
returns a value of
true
The
preventDefault()
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
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.
356
Handling Events
Event.stopPropogation()
method to prevent an event object from continuing
method prevents the event object from moving on to
method. Call the
if the method has already been called and
method will work only if the event's default behavior can be
method or the
method also prevents the event object from
preventDefault()
preventDefault()
isDefaultPrevented()
false
cancelable
method to
preventDefault()
method, which
otherwise.
property of the event

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents