m
m (typo fixing, FULLY-AUTOMATIC)
Line 31: Line 31:
 
next costume</scratchblocks>
 
next costume</scratchblocks>
  
*Effective communication with scripts or [[Sprite|sprites]]
+
*Effective communication with scripts or [[sprite]]s
  
 
<scratchblocks>when gf clicked
 
<scratchblocks>when gf clicked
Line 40: Line 40:
 
say [Hi!] for (1) secs</scratchblocks>
 
say [Hi!] for (1) secs</scratchblocks>
  
*Creating [[Recursion#Recursion_in_Scratch_1.4|tail recursion]]
+
*Creating [[Recursion#Recursion in Scratch 1.4|tail recursion]]
  
 
<scratchblocks>when I receive [run v]
 
<scratchblocks>when I receive [run v]

Revision as of 20:57, 3 January 2014

When I Receive ()
2.0 When I Receive ().png
Category Event
Type Hat

The When I Receive () block is an Events block and a Hat block. Scripts that begin with this block will be invoked once the specified broadcast has been sent by a calling script.

Example Uses

Broadcasts are used to invoke scripts when certain evaluations are met; for scripts to activate once the broadcast is sent, those scripts must wear the When I Receive () block. Some common uses are:

when I receive [Failure v]
show
wait (3) secs
change [color v] effect by (25)
stop all
  • Hiding select sprites when a certain condition is met under a particular evaluation
when I receive [broadcast v]
hide
  • When a scene must be set
when I receive [next background v]
next costume
  • Effective communication with scripts or sprites
when gf clicked
say [Hi!] for (1) secs
broadcast [communicate v]
when I receive [communicate v]
say [Hi!] for (1) secs
when I receive [run v]
. . .
broadcast [run v]

See Also