NJ.
NJ.

Reputation: 2185

My events are being dispatched but nothing is happening? Do they have scope?

I have a flex app under construction that makes use of a lot of . I have a main module that has child modules. Ugh, I know. in one of these sub-modules, i want to know if i click a button. The handler for that button-click resides "higher" up in the app. I added an eventlistener looking for the event that I dispatch down in the sub-module, but no-go. Am I doing something wrong or is there a scope problem or something?

I know this is kinda vague, but I don't really know how to even debug this one, frankly.

Thanks in advance and be gentle. :)

Upvotes: 0

Views: 93

Answers (2)

Ryan K
Ryan K

Reputation: 351

Are you declaring the events that child dispatches? i.e.

[Event(name="eventName", type="eventType")]

Upvotes: 0

Stefan
Stefan

Reputation: 1355

Where do you add the event listener? If you add it not directly to the object that dispatches the event but further up then you need to make sure your event bubbles. Try

dispatchEvent(new Event(YOUR_EVENT_ID), true)

And check this page on event propagation.

Upvotes: 1

Related Questions