When () Clicked
When clicked
Category Control
Type Hat

The When () Clicked block is a Control Block and a Hat Block. This block allows the user to make a script which will only activate when the selected sprite is clicked. The block will run the script every time the sprite is clicked instead of the first time.

Common UsesEdit

Some common uses for this block are:

  • Buttons/Options for menus
  • Scratch OSs
  • Tutorials (clicking a button to move on)

Below are two scripting examples:

When clicked example

This script will ask for input from a user when the sprite has been clicked.

Example Menu button script

The sprite that holds this script will shrink and grow (imitating a button), before making a broadcast.