如何停止在flex中获取鼠标点击事件
我创建了一个层次结构,其中有一个主页,使用添加元素我附加了一个组类型的组件 mxml。主页上有一个按钮,单击时应在该组类型 mxml 组件中添加类型组的子项以及两个按钮。现在,我使用其中一个按钮附加另一个组件 mxml 类型组。问题是即使它们重叠,我仍然可以超出第一组组件 mxml 的子组。我怎样才能阻止这个鼠标事件的发生。
I have made a hierarchy in which there is a main page, using add element i have attached a component mxml of type group. There is a single button on main page when clicked it should add children of type group in that group type mxml component along with two buttons. Now using one of buttons i am attaching another component mxml type group. the problem is even they overlap i can still excess the children groups of first group component mxml. how can i stop this mouse events to happen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这类事件通常会冒泡到父组件。
您可以尝试在鼠标单击事件侦听器中使用以下代码来停止进一步传播:
I think those kind of events usually bubble up to parent components.
You can try using the following code in your mouse click event listener to stop further propagation:
通过将enabled、mouseChildren、mouseEnabled 设置为false,您将禁用整个组件及其子组件。下面的例子
By setting enabled, mouseChildren, mouseEnabled to false, you will disable the entire component and it's children. example below