maandag 23 maart 2009

rollOver and rollOut vs. mouseOver and mouseOut

Wat is het verschil tussen rollOver en mouseOver, en rollOut en mouseOut?

The InteractiveObject class (flash.display.InteractiveObject) in ActionScript 3 has both rollOver and rollOut events as well as mouseOver and mouseOut events.

Both sets of events determine when a mouse enters or leaves the graphics area of an interactive object. The rollOver and mouseOver events fire when the mouse comes in contact with an interactive object, while rollOut and mouseOut occur when the mouse leaves the interactive object.

Where they differ is with their interaction with interactive object children. The roll events (rollOver and rollOut) simplify the process and prevent interference with child events. Essentially, this is the same as using mouseOver and mouseOut with mouseEnabled set to false. mouseOver and mouseOut with mouseEnabled provide a parent sprite with events from its children. rollOver and rollOut keeps the events on the parent object.

Bron + een voorbeeld: http://www.kirupa.com/forum/showthread.php?p=1948052#post1948052

Joren De Smet

Geen opmerkingen:

Een reactie posten