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

Stop sound in HTML5 Canvas

Community Beginner ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

I have 2 frames,

frame 1    menu and background music on loop.

frame 2    different kind of menu and another type of background music

When you press a button in frame 1 it takes you to frame 2 via      gotoAndStop(1);

Problem is, the remaining instance of background music 1 plays and overlaps the background music on frame 2,

I was wondering if there was a way to kill the background music in frame 1 when the button takes you to frame 2.

​Thanks ahead!

Views

8.1K

Translate

Translate

Report

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

Engaged , Nov 22, 2017 Nov 22, 2017

Hi,

try createjs.Sound.stop(); in the code for frame 2. This stops all global audio.

This page might help more...

SoundJS v1.0.0 API Documentation : Sound

Cheers

Greg

Votes

Translate

Translate
Engaged ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

Hi,

try createjs.Sound.stop(); in the code for frame 2. This stops all global audio.

This page might help more...

SoundJS v1.0.0 API Documentation : Sound

Cheers

Greg

Votes

Translate

Translate

Report

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 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

LATEST

For future reference, bear in mind that some common questions have already been asked and answered many times; you just have to search for them in the little box at the top of the thread list. For example, searching for "canvas stop sound" yields these threads, all of which would have answered your question:

Play and Stop sound in HTML5 Canvas

HTML5 flash canva can't stop my sound with "mouseout" function

Muting sounds in Animate CC (HMTL5 Canvas)

Can't stop sound using javascript.

I can't stop sound on html 5 canvas

Votes

Translate

Translate

Report

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