Skip to main content
Participant
July 27, 2009
Answered

Routing Mouse Events through a Sprite in ActionScript 3

  • July 27, 2009
  • 3 replies
  • 730 views

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.

This topic has been closed for replies.
Correct answer

Hi JohannesBlythe,

I think you can use "mouseChildren=false" for that dummy sprite.

Or you can try changing the dummy sprite into graphics.

- Varun

3 replies

Participant
November 9, 2009

Thank you all for the help!  I was able to solve my problem.

funkysoul
Inspiring
July 27, 2009

so you want to disable the top sprite (the decorative one) and enable the sprite below to be clickable?

Then you just need to set mouseEnabled = false to the upper sprite

Cheers

Correct answer
July 27, 2009

Hi JohannesBlythe,

I think you can use "mouseChildren=false" for that dummy sprite.

Or you can try changing the dummy sprite into graphics.

- Varun