In other languages

Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Green Flag

The Green Flag is clicked in this location.

The Green Flag is a programming feature that, when clicked, will start all scripts in that project that are hatted with the When Green Flag Clicked block. More simply, this block starts the project. Offline, pressing the ↵ Enter key on a keyboard will also start all green flag scripts, when not prompted for input by the Ask () and wait block. Also, when ⇧ Shift clicking the green flag, Turbo Mode will be activated, and Ctrl clicking will mute the project so that the project cannot produce any sound ( click on a Mac).

Importance

The image of a flag shows how the block is connected with the actual flag.
Without the flag, no Scratch projects would be able to run unless a key was pressed, a sprite was clicked, or a When () is Greater Than () hat block was triggered to activate the scripts. While creating a project is fully possible without the flag, it is not recommended and many users do so.[citation needed]

Examples of projects which do not use the Green Flag block are:

  • Projects which just share an image
  • Slide shows where only key presses need to be used to move the images

Stop Sign

Main article: Stop Sign

The Stop Sign is the opposite of the flag; a project will end and fully stop all scripts when it is clicked or the Stop () block is used with the "all" option.

History

In Scratch 1.4 and the online Java player, by broadcasting scratch-startclicked the flag was activated, meaning a project can start if a sprite is clicked.

Conversely, a broadcast received block Hat Block with the broadcast scratch-startclicked activates when the green flag is pressed.

As it was never a planned feature, it does not function with Scratch 2.0, and the Scratch Team does not plan on adding it to these versions.[1]

Icon

In older versions of Scratch 2.0, the Green Flag icon could be placed into custom blocks and variables by adding the text "@greenFlag" to the custom block name.

GreenFlagTrick.png

A similar trick could be done with the stop sign by adding the text "@stop" to a custom block.

See Also

References

  1. https://scratcharchive.asun.co/forums/viewtopic.php?id=57153 Known Limitation 3
  • This page was last modified on 9 December 2016, at 20:42.