Routing Mouse Events through a Sprite in Actionscr

2020-02-14 23:40发布

问题:

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;