You want to create an interactive button that enables a user to click and perform an action, such as submitting a form or calculating a total.
Create an instance of the SimpleButton class and create display objects
hitTestState. Alternatively, create a subclass
of SimpleButton that describes
your desired button behavior.
click event to invoke a method whenever the
user presses the button.
The display list model provides an easy way to create buttons through the SimpleButton class. The SimpleButton class allows a user to interact with the display object using their mouse, and makes it easy for you to define that interaction through various button states. The possible button states, listed here, are available as properties of the SimpleButton class:
A display object for the default “up” state of the button. The “up” state is shown whenever the mouse is not over the button.
A display object that determines what the button looks like when the mouse moves over the button. When the mouse leaves the button area, the button moves back to the “up” state.
A display object that’s shown when the button is pressed (or clicked) “down”. When the button is in the “over” state, the “down” state displays when the user presses the left mouse button.
A display object that defines a button’s bounds. When the mouse moves inside of the button’s hit area, the button enters ...