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!
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
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
Copy link to clipboard
Copied
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)