Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Nov 03, 2016 Nov 03, 2016

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!

1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 03, 2016 Nov 03, 2016

// stop all sounds

createjs.Sound.stop();

Translate
LEGEND ,
Nov 03, 2016 Nov 03, 2016

// stop all sounds

createjs.Sound.stop();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2016 Nov 04, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2016 Nov 04, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2016 Nov 04, 2016
LATEST

According to your first post you'd already figured out how to make things happen on a button click, but not how to stop all sounds. Now you're claiming the opposite of that.

Sigh.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines