通过雪碧路由鼠标事件的ActionScript 3 [英] Routing Mouse Events through a Sprite in Actionscript 3

查看:172
本文介绍了通过雪碧路由鼠标事件的ActionScript 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个纯ActionScript 3的项目,我有一个精灵重叠另一个精灵。较低的精灵一般处理鼠标点击。下部子画面不再处理鼠标事件时,它是由较高的子画面重叠。

In a pure Actionscript 3 project, I have a sprite that overlaps another sprite. The lower sprite normally handles mouse clicks. The lower sprite no longer processes mouse events when it is overlapped by the higher sprite.

据我所知,这是正常的行为。

I understand that this is normal behavior.

我想下精灵来处理鼠标事件是重叠的时候。 (在我的特殊情况,上级精灵仅仅是一个装饰件;它没有普通鼠标交互反正)这可能吗?有没有一种方法来路由鼠标事件通过更高的精灵?

I would like the lower sprite to handle mouse events when it is overlapped. (In my particular instance, the higher sprite is just a decorative piece; it has no normal mouse interactivity anyway.) Is this possible? Is there a way to route mouse events through the higher sprite?

我发现了一个很短,约约会我的问题的讨论在这里:

I found a short, dated discussion about my problem here:

http://kb2.adobe.com/cps/137/tn_13766.html

感谢你。

推荐答案

应该是这样的:

higherSprite.mouseEnabled=false;
higherSprite.mouseChildren=false;

这篇关于通过雪碧路由鼠标事件的ActionScript 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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