By passing a MouseEvent to a function. Look up Mouse Events in the help files. Plenty of leads.
Thanks for the quick answer, but my project already has a mouse event listener which does something else.
Is there no other way?
I mean a way where it refers directly to the button?
1 person found this helpful
You can also try to create an event listener for the button itself. (In as2.0 it was onClick or onPress or something to that effect, now I'm not sure what they are syntaxed as but there are event listeners for buttons which "listen" to see if the button has been pressed. Mouse Events are good because it makes sure that the mouse is actually performing the action. Don't know about accessibility with Mouse Events though since you can use a Tab key to direct input of buttons so try the Button event listeners.