Skip to main content
Participating Frequently
November 3, 2016
Answered

Animate CC audio controls using javascript on button click in HTML5 canvas

  • November 3, 2016
  • 4 replies
  • 2083 views

I'm struggling with finding the right combination of code, or perhaps this is complete user error as I'm not a coder nor savvy in javascript... But I'm searching for a way to use a button to stop a looping sound from continuing after being clicked in a HTML5 canvas document. Upon click, the current movie clip animation stops (the video) and a new movie clip starts. Right now, the sounds are overlapping and the looped sound just doesn't stop.

Any help would be much appreciated!

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer ClayUUID

// stop all sounds

createjs.Sound.stop();

4 replies

ClayUUIDCorrect answer
Legend
November 3, 2016

// stop all sounds

createjs.Sound.stop();

Participating Frequently
November 4, 2016

I've tried that, and it does successfully stop the sounds, but I can't figure out how to trigger it on a button click. Any advice there?

Participating Frequently
November 4, 2016

Actually, through guessing... I figured it out!!! Thank you so much!