Broadcast

The Broadcast command lets you send messages between sprites.

For example when one sprite is clicked, another sprite will do something.

Broadcast Command Video

This is the code for your coloured box

 

This is the code for the teacher

Link to the program : https://scratch.mit.edu/projects/l_doyle/753341