通过 Actionscript 3 中的 Sprite 路由鼠标事件 [英] Routing Mouse Events through a Sprite in 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 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 中的 Sprite 路由鼠标事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!