popup – Flex 3: How do I reference the Modal Button in a Custom Component? – Education Career Blog

I’ve got a custom component based on a TitleWindow. I want to put an event listener in my main app that listens for the Titlewindow’s modal button’s click

Custom Component:


blah blah…


In the main app:

I’ve got a variable called popWindow, which is the above component. How do I reference the TitleWindow’s modal button?

I want to do something like this:

popWindow.modal button reference.addEventListener(MouseEvent.CLICK, myFunction);

Thank you.



Have you tried adding the event listener to popWindow directly? That MouseEvent should bubble; you will have to check the target on it though to make sure it is the click you are looking for.

Edit: you could also dispatch out a new event in your close handler and listen for that event on this outside, by just adding an event dispatcher on your popWindow as well.

Leave a Comment