加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在Flex Canvas触发子元素上停止Mouse Out事件

发布时间:2020-12-15 01:49:02 所属栏目:百科 来源:网络整理
导读:我使用Canvas itemRenderer作为我用来显示图像的容器.请参阅下面的伪代码. image = new Image();image.source = data.@thumb;this.addChild(image);this.addEventListener(MouseEvent.MOUSE_OVER,enlarge(image));this.addEventListener(MouseEvent.MOUSE_OU
我使用Canvas itemRenderer作为我用来显示图像的容器.请参阅下面的伪代码.

image = new Image();
image.source = data.@thumb;
this.addChild(image);
this.addEventListener(MouseEvent.MOUSE_OVER,enlarge(image));
this.addEventListener(MouseEvent.MOUSE_OUT,shrink(image));

当我将鼠标悬停在画布上时,会调用放大功能.但是,只要我将鼠标移动到图像或其他子元素上,就会触发MOUSE_OUT事件.

任何人都可以指向一个方法来禁用这种行为吗?

谢谢 :)

解决方法

您应该使用 MouseEvent.ROLL_OVERMouseEvent.ROLL_OUT事件.

从Flash CS4文档:

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读