Actions
A state can do things as well as play: change a variable, send a message, jump to a frame, open a link, or tell the page around the file. Each action has its moment: when the state starts, at its end, each time a loop ends, or when it leaves. Here the switch counts how often it is turned on, and tells the page.
Step by step
Open the state
Click On on the chart. Its editor opens upward from the box: how it plays, Does, and Leaves when.
Count it
Click + beside Does and pick + / −. The row reads as a sentence: When it starts, Times on + 1. Its moment, its variable and the amount are menus and a field on the row.
Tell the page
Click + again and pick Send to the page, then type switched-on and press Enter. In an exported file the SVG fires a cin:event with that name, for the page's own script.
Try it
Click the switch on the canvas a few times. Times on, in Variables, goes up each time it turns on, and What happened says what the page would hear.
Keys
| Esc | Close the editor |
| Space | Start the preview again |