Thursday, February 28, 2013

AS3: Custom Components Flicker / Mouse Event Bubbling

Problem:
While working on a project, I added some button components within another component and then had the buttons hide unless the mouse was over the entire component. Each time I would move the mouse around over the component, the buttons would show and hide quickly causing a flickering.

Solution:
I had forgotten that there is a different between MouseEvent.MOUSE_OVER and MouseEvent.ROLL_OVER. Using MOUSE_OVER defaults the events to bubble which causes other listening items to respond to that event whereas ROLL_OVER doesn't bubble the event.

No comments: