User Guide

89
Figure 7. A basic login prompt using strings
4.7 Messages
In Scratch, all scripts are associated with an individual sprite and
run independently of any other scripts. Messages allow the
different sprites on the Stage to communicate and synchronize
with each other. These messages are never shown to the user.
In the Controls section of the Blocks Palette, there are two blocks
for sending messages, and one for receiving them:
To send a message from a sprite:
1. In the Blocks Palette, drag a broadcast block over
to the Scripts Area and into position.
2. On the block, click the down arrow, and then either
click the name of the message that you want to
send, or click new to create a new message.
Block Description
broadcast ? Sends the specified message to all sprites in the
project.
broadcast ? and wait Sends the specified message to all sprites in the
project and then waits. When all of the sprites that
listen for that message have finished their work,
Scratch runs the blocks that are snapped onto the
bottom of the broadcast and wait block.
when I receive ? Starts a new script when a sprite receives the
specified message.