Skip to content

Play a sound on click

Use a click handler to play one of the spriteโ€™s sounds whenever the player interacts with it.

whenClicked(() => {
startSound("meow");
});

Replace "meow" with the name of any sound added to the sprite in the editor.

whenClicked(() => {
playSoundUntilDone("meow");
say("Done!");
});
  • whenClicked โ€” run code when this sprite is clicked
  • startSound โ€” start playing a sound without waiting
  • playSoundUntilDone โ€” play a sound and wait until it finishes
  • say โ€” show a speech bubble
All recipes