Nate
Nate

Reputation: 2326

Flex: Bubble events from custom classes - non-UI

I'm trying to find a good way to bubble events up a class tree for none-ui components.

I have a structure like this:

I would like to handle the event raised in Child Unit 1 in the Controller. I've tried to set the bubble property to true but I've read that this only works for UI components.

Is there a way to enable this for custom classes that are not UI components?

Upvotes: 1

Views: 252

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

Bubbling only works if the class is part of a display hierarchy. Otherwise, how would you tell what the classes parent is? Even a UIComponent that has not been added tot he stage will not bubble events.

For non UIComponents, you're going to have to listen for, and re-dispatch, the event at each level.

Upvotes: 3

Related Questions