
Choosing Events
Chapter 15
450
14 // register events
15 enterBtn.addEventListener(
MouseEvent.ROLL_OVER, handleClick );
Script 15.9 Switching from a click event to a rollover
event.
14 // register events
15 enterBtn.addEventListener(
MouseEvent.ROLL_OUT, handleClick );
Script 15.10 Registering for the rollout event.
Choosing Events
As users interact with a button, their mouse
movements trigger various events. Releasing
the mouse button while still over the button’s
active area triggers the
click
event. Rolling
over and out of a button area triggers other
events. To make a button react to these
events, you must change your script to regis-
ter for the d ...