A push interactor is used to change the appearance of
one or more objects when a mouse event occurs. By default, a Push
interactor intercepts three mouse events: PRESSED, RELEASED, and CLICKED.
When a mouse event occurs, the following values that represent the
state of the object are passed to conditions
BUTTON_UP - Sent when the mouse is released,
or when it is dragged out of the symbol
BUTTON_DOWN - Sent when the mouse is
pressed and moves over the symbol
BUTTON_CLICKED - Sent when the mouse
is released over the symbol
These events fulfill conditions attached to one or more
objects in the symbol. An example is a button that changes color when
clicked.
To add a push interactor to a symbol:
-
In the Symbol Editor, create a new symbol.
-
Create a String parameter click
.
This parameter holds the string value of the mouse event.
-
-
Select the Interactor tab in the Styling Customizer.
-
Select Push in the Interactor field.
Three new conditions are created under the Shape object
in the Symbol Outline pane.
-
Select the BUTTON_DOWN condition in the Symbol Outline
pane.
-
Select the Paint tab in the Styling Customizer.
-
Click the button at the right of the Fill Paint field.
The Paint Editor opens.
-
In the Radial Gradient tab, change the gradient type
from Pad to Reflect.
-
-
Save this symbol as basicbutton
in a new buttons category in the bampalette.
When you run this symbol in Preview mode, the Shape object
changes color when it is clicked.
Note
You do not have to customize all three automatic push
conditions. Delete the conditions you do not use.