Mouse events bubble, not blow, or blow bubbles.  You can read up on
bubbling in the doc or on the W3C site.  If it were to truly "blow" I
don't think the W3C would have approved it.

 

Your display object tree looks something like:

 

App

  |

Container

  |

Button

 

When you click on the button, the click will bubble up from the button
to the Container to the App.  If you handle the click at the button
level, and in doing so add a click listener to the app, when it bubbles
up it will see it.

 

You'll have to add the click event later, or set a flag to ignore the
first click it sees.

 

Bubbling actually allows you to listen for all clicks in an app in one
place, but you have to understand the rules.  Note that you will also
get clicks from scrollbar buttons, Tabs and other things you may not
think of as buttons, so you'll probably want to filter in your hanlder
anyway.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ashley
Sent: Monday, November 05, 2007 2:22 PM
To: [email protected]
Subject: [flexcoders] Re: Event issue. Please help.

 

I am adding it to the entire application as I want to be notified of
any click in the application window.

Let me get this straight. If I add a mouse listener during a state
changed event then the mouse listener will receive the the state
changed event? Or it's receiving the mouse click event that caused the
state change? Either way it blows. How do I add the mouse event
listener then?

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
> Looks like you're adding the click handler to the entire
> document/application.
> 
> Most mouse events bubble, so if you add a listener to the parent in
your
> handler it will see it after you handle it.

 

Reply via email to