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 flag starts the project. ⇧ Shift clicking the green flag will activate Turbo Mode.
In Scratch 2.0, Ctrl clicking would mute the project so that the project could not produce any sound (⌘ click on a Mac). In the Scratch 1.4 offline editor, pressing the ↵ Enter key on a keyboard would also start all green flag scripts, when not prompted for input by the Ask () and wait block.
Importance
when gf clicked
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 most users use the green flag.[1]
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. Some people have suggested a "When stop sign clicked" block, however this has been rejected by the Scratch Team.[2]
History
In Scratch 11Oct03, the first version of the flag was a purple button, multiple of which could be created for each script. It was then changed to a green play sign that "shouted" "go" and "setup" when clicked (later replaced with sending messages) in 13Oct04. After that, it was changed to a start button in 28Feb05, and in 14Mar05 a "when Start clicked" block was added. It stayed that way until Scratch 28May05 when it was turned into a green flag as it is today. In Scratch 1.4, the green flag and stop sign were made smaller.
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.[3]
Custom Block Insertion
This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. |
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.
A similar trick could be done with the stop sign by adding the text "@stop" to a custom block.
Requesting multiple clicks
Some users will request clicking the green flag a certain amount of times before playing. This improves the sync of the When Green Flag Clicked Blocks so that assets of the project will line up correctly.
See Also
References
- ↑ griffpatch's Cloud Platformer Multiplayer Fun mentions the block 18 times.
- ↑ post:2070854
- ↑ ar-topic:57153 Known Limitation 3