flex 中自定义组件上的 Click-outside 事件 [英] Click-outside event on custom components in flex

查看:24
本文介绍了flex 中自定义组件上的 Click-outside 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法编写一个自定义事件,当用户在该自定义组件实例之外单击时触发该事件?基本上在主 flex 应用程序中的任何其他地方.谢谢.

Is there a way to write a custom event that gets triggered when the user clicks outside of that custom component instance? Basically anywhere else in the main flex app. Thanks.

推荐答案

您可以使用 FlexMouseEvent.MOUSE_DOWN_OUTSIDE 事件.例如:

You can use the FlexMouseEvent.MOUSE_DOWN_OUTSIDE event. For example:

myPopup.addEventListener(
   FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
   function(mouseEvt:FlexMouseEvent):void
   {
       PopUpManager.removePopUp(myPopup);
   }
);

这篇关于flex 中自定义组件上的 Click-outside 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆