开发者

Flex 3: How do I reference the Modal Button in a Custom Component?

开发者 https://www.devze.com 2023-01-20 21:03 出处:网络
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

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:

<mx:TitleWindow 
  showCloseButton="true" 
  close开发者_StackOverflow="closeHandler(event)">

blah blah...

<mx:TitleWindow>

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:

(Pseudo-code) popWindow.[modal button reference].addEventListener(MouseEvent.CLICK, myFunction);

Thank you.

-Laxmidi


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号