enter-aisyah and scene-2 label every moment of the play. Today we learn to name, pick, and rename messages so the project stays readable as it grows.Learning Goals 3 min
By the end of this lesson you will be able to:
- Explain why a broadcast name should describe an event (e.g.
game over) and not an action (e.g.say hello and turn red). - Open the broadcast dropdown and pick an existing message instead of retyping it — and explain why retyping causes silent bugs.
- Use the Edit message… option to rename or delete a broadcast across the whole project in one click.
Warm-Up — two whistles that sound the same 7 min
Priya is making a tiny racing game. She has a Cat sprite and a Dog sprite. The Cat is the marshall — it counts down, then yells "GO!" so both racers start running. Here are the Cat's broadcast and the Dog's listener:
when flag clicked
say [3] for (1) seconds
say [2] for (1) seconds
say [1] for (1) seconds
broadcast (start race v)
when I receive (start Race v)
move (10) steps
move (10) steps
move (10) steps
Priya hits the flag. The Cat counts down. The Dog never moves. Priya stares. Both blocks say "start race" — why doesn't the Dog hear it?
Reveal the answer
Look carefully. The Cat broadcasts start race — lowercase. The Dog listens for start Race — capital R. To Scratch, those are two completely different messages. The Dog is listening for a whistle that nobody ever blows.
Worse: in the dropdown for the Dog's hat, both names now exist side by side. Priya created the second one by accident the first time she typed it. Today's lesson is the rule that prevents this forever: pick from the dropdown, don't retype.
Now try this one. Aisyah named her broadcast say hello and turn red. A week later she wants the same cue to also play a sound. What's wrong with that name?
Reveal the answer
The name describes what some listener does, not what just happened in the world. If she now adds a sound, the name lies — it still says "say hello and turn red" but the actual behaviour is different. A better name describes the event itself: player won, or round started. Then any listener can react however it wants, and the name stays true forever.
New Concept — broadcast names are shared, and they stick 15 min
You met broadcast (message1 v) in L02-20 and when I receive (message1 v) in L02-21. L02-22 added broadcast (message1 v) and wait. Three lessons in, you have probably noticed that the dropdown is starting to fill up with names. Today is the lesson about that dropdown.
One list, the whole project
Every broadcast name you create lives in a single shared list. That list belongs to the project, not to a sprite. So if the Cat creates start race, the Dog can see start race in its dropdown without anyone copying anything. Same for the Stage. Same for every new sprite you add later.
broadcast (start race v)
broadcast (game over v)
broadcast (next round v)
Two ways to fill the slot
Click the small ▾ inside any broadcast or when-I-receive block. You get a menu with two parts:
- Existing messages — every name you have already created in this project.
- New message… — opens a tiny dialog asking for a name. Press OK and the new name joins the list.
Here is the rule that will save you from 90% of broadcast bugs:
Edit message… — rename or delete across the whole project
Right-click any broadcast or when-I-receive block. One of the options is Edit message. (You can also right-click the message name inside the block.) You get two choices:
- Rename — change the name. Every block in the whole project that uses that message updates instantly. You don't have to chase down the listeners on six other sprites — Scratch does it for you.
- Delete — remove the message from the project. Any block that was using it goes back to showing
message1or asking you to pick a new one.
This is huge. It means you can start a project with a rough name like thing1, and once you understand what the cue really means, rename it to player crossed finish line in one click — every sprite updates together.
How to name a message well
Two principles. Both come from professional programmers, and both are easy.
1. Describe the event, not the reaction
A broadcast is a cue. The cue says "this just happened in the world". It does not say "here is what every listener should do" — each listener decides that for itself.
broadcast (game over v)
broadcast (say hello and turn red v)
2. Lowercase, short, no punctuation
Scratch is case-sensitive on broadcast names. game over and Game Over are different messages, and the dropdown will show both, side by side, almost identical. Pick one style and stick to it. The Hub style is: all lowercase, spaces are fine, no question marks or exclamation marks, keep it under four words.
- Good:
start race,game over,door opened,scene 2,bell rang. - Bad:
Start_Race!!,game over (final),sprite 1 should now jump and the music should change.
When projects get big
At 1 or 2 messages, names barely matter. At 5+ messages, naming is the difference between a project you can edit next week and a project you can't. Most of the L02 capstone projects you'll build (starting next lesson) use 3–6 messages. By Level 3, you'll have projects with a dozen. Good habits now, calm projects later.
Worked Example — fixing the dropdown 12 min
Open Scratch. We're going to deliberately create the duplicate-message bug, then fix it the right way. Then we'll rename a message across the whole project in one click.
Step 1 — Start fresh, add a second sprite
New project. Default Cat. Click the small cat icon at the bottom-right of the sprite list and pick the Dog sprite. You now have two sprites.
Step 2 — Cat broadcasts a new message
Click the Cat. Drop when ⚑ clicked, then broadcast (message1 v). Click the dropdown → New message… → type start race → OK.
when flag clicked
broadcast (start race v)
start race.Step 3 — Dog listens — the wrong way
Click the Dog. Drop when I receive (message1 v). Click the dropdown → New message… → type start race → OK. Deliberately make the bug. Add a move (50) steps underneath.
when I receive (start race v)
move (50) steps
Step 4 — Click the flag and see the silence
The Cat broadcasts. The Dog doesn't move. Two messages share the same name but are different cues. The Cat is shouting into the wrong one.
Step 5 — Open the dropdown and look
Click the Dog's when I receive (start race v) dropdown. You'll see two start race entries. That's the bug. Two whistles that sound the same to your eyes but different to Scratch.
Step 6 — Fix by picking from the dropdown
From the Dog's dropdown, pick the first start race entry (the one the Cat created). Now both blocks point at the same message.
Step 7 — Delete the orphan message
Right-click the Dog's hat block → Edit message → wait, the right way is: right-click the message name and switch to the duplicate so you can see it, then right-click again → Delete this message. The duplicate disappears from the project.
Step 8 — Rename across the whole project
Now rename the message project-wide. Right-click any broadcast or receive block that uses start race → Edit message → type round started → OK. Look at the Cat. Look at the Dog. Both blocks now say round started. You changed two blocks on two different sprites with one click.
Step 9 — Click the flag
Cat broadcasts round started. Dog hears it. Dog moves. The project works, the name is honest, and any future listener can join in just by picking the same name from the dropdown.
The full assembled pair
when flag clicked
broadcast (round started v)
when I receive (round started v)
move (50) steps
What you just practised: the entire daily workflow of working with broadcasts. Pick from the dropdown, not the keyboard. Rename project-wide with Edit message. Delete orphan duplicates the moment you spot them.
Try It Yourself — three naming drills 15 min
Goal: Add a third sprite (Ball) to the project from the worked example. Make the Ball also react to round started. Do not retype the message name. Pick it from the dropdown.
when I receive (round started v)
go to x: (-200) y: (0)
glide (2) secs to x: (200) y: (0)
Think: You never opened "New message…". You just clicked ▾ and the name was already there, because the Cat had already created it. That is the whole rule — let the project remember names for you.
Goal: Aljay started a project with a badly-named broadcast: turn red and shrink. Rename it across the whole project to player hit using Edit message, so the name describes the event, not the reaction.
when flag clicked
forever
if <touching [arrow v] ?> then
broadcast (turn red and shrink v)
end
end
when flag clicked
forever
if <touching [arrow v] ?> then
broadcast (player hit v)
end
end
Think: One Edit message rename changed both the broadcast on the player and the when-I-receive on any listener Aljay had already wired up. He didn't have to touch six sprites by hand.
Goal: Build a tiny "kuih stall opens" project. The Stall sprite broadcasts stall open. Three customer sprites (Aisyah, Daniel, Priya) each listen for stall open and glide toward the stall. All three customers must use the same message — picked from the dropdown.
when flag clicked
wait (2) seconds
say [Stall open! Datang lah!] for (2) seconds
broadcast (stall open v)
when I receive (stall open v)
glide (3) secs to x: (0) y: (0)
say [Teh tarik satu!] for (2) seconds
Think: When you add Daniel and Priya, you'll be tempted to retype stall open each time. Resist. Open the dropdown — the name is already there. Three sprites, one dropdown entry, zero duplicates.
Mini-Challenge — Daniel's missing whistle 5 min
"Daniel's silent dancer"
Daniel built a dance project. The Stage broadcasts a cue when the song hits the beat. The Dancer sprite is supposed to do a little jump. Here are both blocks:
when flag clicked
forever
wait (1) seconds
broadcast (beat v)
end
beat once per second.
when I receive (Beat v)
change y by (30)
wait (0.2) seconds
change y by (-30)
Daniel double-checks the spelling — both say "beat", four letters. Why doesn't the Dancer jump? And how should Daniel fix it without deleting and rebuilding the Dancer's script?
Reveal one valid solution
Look at the cases. Stage sends beat (lowercase b). Dancer listens for Beat (capital B). To Scratch those are two separate messages, and the dropdown almost certainly contains both — Daniel typed each one fresh instead of picking from the dropdown.
The right fix is not to retype. It's to use Edit message. Right-click the Dancer's hat block → Edit message → change Beat to beat (matching the Stage's spelling). Press OK. Now both blocks refer to the same shared message.
While he's there, Daniel should open the dropdown on either block — if Beat still appears as an option, that means the orphan twin is still floating around. Right-click → Delete this message to clear it.
when I receive (beat v)
change y by (30)
wait (0.2) seconds
change y by (-30)
The lesson: when a broadcast "doesn't work", the first thing to check is the dropdown, not the spelling of the typed name. If the same name appears twice in the dropdown, that's your bug staring you in the face.
Recap 3 min
Broadcast names live in a single list that belongs to the project, shared by every sprite and the Stage. Each name should describe an event ("game over", "round started", "door opened"), not a list of reactions. When you wire up a listener, pick the name from the dropdown instead of retyping it — retyping creates a silent twin and your listener goes deaf. When you need to change a name, right-click any block that uses it and pick Edit message — Scratch renames every use in the whole project at once. Good naming hygiene barely matters at one or two messages, but by the time your project has five or more, it is the difference between code you can edit calmly and code you can't.
- Message
- A named cue you can broadcast across a Scratch project. Stored in a single shared list — every sprite sees the same dropdown.
- Pick-Don't-Retype Rule
- Always select an existing message name from the broadcast or when-I-receive dropdown. Only use New message… for genuinely new cues. Retyping creates duplicate messages that look identical but are not.
- Edit message
- Right-click option on any broadcast or when-I-receive block. Lets you rename or delete a message across the whole project in one click — no sprite-by-sprite chasing.
- Event name
- A short, lowercase description of what just happened in the world (e.g.
player hit), not what should happen next (e.g.turn red and shrink). Event names stay honest as projects grow. - Orphan message
- A message that exists in the project's dropdown but isn't sent by anything. Usually the leftover of a retyping mistake. Delete with right-click → Edit message → Delete.
Homework 2 min
The Five-Message Spring Clean. Open one of your old Scratch projects (or build a fresh one with at least four sprites). Audit every broadcast.
- Open every broadcast (… v) and when I receive (… v) in the project and write down all the message names you see. (Just on paper or a note app — no Scratch trickery.)
- Spot any pair of names that mean the same event but are spelt differently (e.g.
startandStart, orgame overandgameover). Use right-click → Edit message to merge them — rename one to match the other. - Spot any name that describes an action instead of an event (e.g.
turn green,play sound and hide). Rename it to describe the event (checkpoint reached,enemy defeated). - Spot any orphan message — one that appears in the dropdown but isn't sent by any block. Delete it.
- Save as
HW-L2-23-Five-Message-Spring-Clean.sb3.
Bring back next class:
- The
.sb3file. - A short note (3–4 sentences) listing: how many messages the project had before, how many after, and one duplicate or bad name you fixed.
- Your answer to: "If a broadcast appears in the dropdown but no sprite broadcasts it, what happens when the flag is clicked?"
Heads up for next class: SCR-L02-24 is the cluster-D capstone — a two-sprite scripted conversation using four named messages, broadcast-and-wait, and the naming hygiene you just learned. You will need every habit from this lesson.