How to stop Mouse Out event on Flex Canvas firing for child elements

爱⌒轻易说出口 提交于 2019-12-01 19:27:45

You should use MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT events instead.

From the Flash CS4 documentation:

When the mouse enters the area of a display object or the area of any of its children from an object that is not one of its children, the display object dispatches the rollOver event. This is different behavior than that of the mouseOver event, which is dispatched each time the mouse enters the area of any child object of the display object container, even if the mouse was already over another child object of the display object container.

I agree with Josh that the ROLL_OVER events seem more appropriate to what you're doing. However, you should be aware of the mouseChildren property of flash.display.DisplayObjectContainer (an ancestor of UIComponent).

Rollout works for me. About the comboBox problem: You can also check if the target of the event is a child from the container.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!