Blocks that look like this can be used to detect an event such as clicking on the sprite, pressing a key, or clicking the green flag button. They tell the script to start when that event occurs. Because these blocks can sit only on top of a script (as a way to start the script), Snap! programmers call them "hat blocks."
Clicking the green flag () starts all scripts that begin with the
when green flag is clicked
hat block. You can stop all running scripts by clicking the red stop sign () at the top right of the Snap! window.
say
a welcome message whenever the green flag is clicked. (Alonzo might say, "Welcome to 'Click On Alonzo!' Keep clicking me if you can!") .