ScratchData LogoScratchData
Back to TheLogFather's profile

Script execution order

THTheLogFather•Created February 26, 2014
Script execution order
86
70
2079 views
View on Scratch

Instructions

Another quick project to demonstrate the execution order of scripts within and across sprites (and Stage). The list shows the order of execution, Click on a sprite to bring it to front, then hit GF again to see new run order. See inside for all the Green Flag scripts of each sprite.

Description

Scripts are executed for the topmost layered sprite/clone first, going down the layering, until finally it starts up the scripts on the Stage. Within a sprite, the scripts are executed from the lowest to the highest, in terms of layering within the editor pane. (NOTE: above was true for Scratch 2, but it's different in Scratch 3... instead, S3 executes scripts in the order that their hat-blocks were created. So scripts with earlier hat-blocks will execute first in order. That means changing the layer order of scripts in this project will no longer change the execution order in the way that this project claims. However, you *can* still change execution order by swapping their hat-blocks.) This works both for Green Flag and for broadcasts. Note: there's no guarantee Scratch will continue to work this way!

Project Details

Project ID18490761
CreatedFebruary 26, 2014
Last ModifiedNovember 2, 2020
SharedFebruary 26, 2014
Visibilityvisible
CommentsAllowed