Creating a push interactor

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:
  1. In the Symbol Editor, create a new symbol.
    For more information, see Making a new symbol.
  2. Create a String parameter click .
    This parameter holds the string value of the mouse event.
  3. Select the Shape object.
  4. In the Styling Customizer, select the Interactor tab.
  5. From the Interactor list, select Push.
    Three new conditions are created under the Shape object in the Symbol Outline pane.
    diasym_interactorpush16.png
    Automatic parameters for a push interactor
  6. In the Symbol Outline pane, select the BUTTON_DOWN condition .
  7. In the Styling Customizer, select the Paint tab.
  8. Click the button at the right of the Fill Paint field.
    The Paint Editor opens.
  9. In the Radial Gradient tab, change the gradient type from Pad to Reflect.
  10. Click Apply.
  11. 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.