如何将点击事件传递给动作脚本中的其他子级?
我的装饰位图之一掩盖了我的 Flex 应用程序中的一些重要元素。问题是这些元素变得不可点击。如何使位图不可点击,或者如何将点击事件传递给下面的那些子元素?
One of my decoration bitmaps covers up some important elements in my flex application. The problem is these elements become not clickable. How could make the bitmap not clickable or how could I pass the click event along to those children elements below?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以为位图和需要访问的元素使用一个公共容器,因为位图不可单击,所以容器本身需要可单击并侦听需要分派的鼠标单击事件,还要确保
:基本思想是,如果您的元素位于位图下的另一个容器中,则位图将充当屏幕,如果元素位于同一个容器中,则位图无法屏蔽鼠标事件,因为容器本身就是EventDispatcher。
You could have a common container for both the bitmap and the elements you need to access , since a bitmap is not clickable , the container itself needs to be clickable and listen to the mouse click event you need to dispatch, also make sure that:
The basic idea is that if your elements are in another container under the bitmap, the bitmap will act as a screen, if the elements are in the same container , the bitmap cannot screen the mouse events since the container itself is the EventDispatcher.
您可以在 mx.controls.Image 或位图加载到的任何容器上设置 mouseEnabled = false。
You can set mouseEnabled = false on mx.controls.Image or whatever container the bitmap is loaded into.