Routing Mouse Events through a Sprite in Actionscript 3

北战南征 提交于 2019-11-28 10:41:32

问题


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

Thank you.


回答1:


Should be something like this:

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


来源:https://stackoverflow.com/questions/1187013/routing-mouse-events-through-a-sprite-in-actionscript-3

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