
Using One Event Handler for Multiple Events
Basic Interactivity
457
Figure 15.30 To create an additional button quickly ,
duplicate the button instance, then modify the script.
Be sure to give the duplicate a different instance
name. You can later swap out the symbol with
matching graphics.
Using One Event Handler
for Multiple Events
Earlier in this chapter, you created individual
event handlers for multiple events. Another
way to deal with multiple events is to use one
event handler with a parameter. With this
technique, you create a script that examines
the
pEvent
parameter that you’ve de ned as
part of the event-handler function to react
di ...