When stop button clicked block

Yes it does. However, it can only run for one frame

no it didn't work

yes it does.
untitled script pic (8)

Two things:

  1. the rest of the program can't use the timer, and
  2. the user will have to click the red square for it to work

Isn't the stop button for stopping projects, like in scratch? i don't see any real reason to support this

elaborate on how this would help plz

We put in the when stop feature for the sake of robots that must be sent a stop signal to stop its motors.

um... ok???????

How to get the red square?

if the project has a generic WHEN block in it, the red square will appear automatically when you press the stop button


here's a workaround that can run for more than one frame:
//in a new sprite:
when I am [stopped v] :: control hat
set [pixelate v] effect to (0.05)
when I am [stopped v] :: control hat
clear graphic effects
when gf clicked :: control
clear graphic effects
when <([pixelate v] effect :: looks) =(0.05) :: grey) > :: control hat
broadcast [stop sign clicked v] :: control
when I receive [stop sign clicked v] :: control // this in the wanted sprite
. . .
wait until <(ask [the new sprite v] for (([pixelate v] effect :: looks) :: grey ring) :: control) = [0]>
now, the green flag stops the stop sign scripts, but the stop sign still stops the other scripts. if you want the stop sign to stop those too, delete the when ⚑ clicked script (I think).

Thank you.


This does not work for me. Project: https://snap.berkeley.edu/snap/snap.html#present:Username=donotforgetmycode_snap&ProjectName=stop%20bug

It worked in an earlier version. I know how to fix it, modify the "when ⚑ clicked" script in "Sprite" for that project: Screen Shot 2021-01-16 at 12.48.04 PM

That doesn't work either

okay, now modify this other script to the following: Screen Shot 2021-01-16 at 1.02.32 PM

still doesn't work

oh, I forgot to tell you: delete the Screen Shot 2021-01-17 at 9.32.45 AM script

thanks. now it sort of works, but you need to click the stop button twice. is there any way to fix that?

no, because of the when <> hat block rule.