Just great
Just when I thought I mastered the MouseEvents in as3 (after trying almost every combination of MouseEvents, buttonMode and mouseChildren) I found a new problem situation; only this time I can seem to find a solution.
The situation looks like this:
- The two shapes are siblings so they have the same parent (i.o.w. the two shapes can’t be nested).
- The blue oval is on top of the green rectangle.
- I want to know when the mouse leaves the green rectangle.
The problem is that the green rectangle dispatches a ROLL_OUT and MOUSE_OUT event as soon as the mouse hits the blue oval.
I tried all combinations of mouseChildren, buttonMode and enabled on the oval and on the parent of the two clips, but nothing seems to make the oval not “steal focus” of the rectangle.
Here is the source of the test: Rollout test (zip)
I can think of some workarounds (hitArea, using an invisible button, etc.) but I much rather find a straight way to handle this kind of situation.
Since this was never a problem in as2 I believe there should be a decent solution in as3 as well.
If someone has an answer to this problem or knows about a secret property I haven’t tried, please let me know…








