Search code examples
actionscript-3flashbuttonmousemovieclip

How to detect the mouse cursor through another symbol?


Consider this situation. You have a Movie Clip (red), that contains a Button (green) and another Movie Clip (blue) on top of that Button.

picture

The picture here is considered to be "from the side", with the top "closer to the user".

Now, of course, the Movie Clips are receiving mouse input just fine. But for the button; I'd like for it to also detect the mouse when it is over the blue Movie Clip.

I tried setting mouseEnabled = false for the blue Movie Clip, no effect.

Is there a better way to do this than converting the Button to a Movie Clip and gotoAndStop? That would take time, so I'd like to know if there is an easier way.


Solution

  • You should set mouseChildren= false on the blue Movie Clip for it to work.