Problem Play and Stop sound - Canvas
Hi,
I don't quite understand something.
I have 2 sounds in a different frame. I would like my sound1 in the first frame to loop and starts automatically from the beginning.
My sound2 is in frame2. When you click on a button to go to frame2, sound2 starts.
When I go back to frame1 and mute the sound2, the sound1 also cuts out.
While I would just like to mute the sound 2.
var sound1 = createjs.Sound.createInstance("music");
sound1.addEventListener("complete",completeF);
sound1.play();
function completeF(){
sound1.play();
}
var sound2 = createjs.Sound.createInstance("music2");
sound2.addEventListener("complete",completeF);
sound2.play();
function completeF(){
sound1.play();
}
this.closebutton.addEventListener("click", son);
function son () {
createjs.Sound.stop("music2");
}
I also tried that :
var sound1 = createjs.Sound.createInstance("music");
sound1.addEventListener("complete",completeF);
sound1.play();
function completeF(){
sound1.play();
}
var sound2 = createjs.Sound.createInstance("music2");
sound2.addEventListener("complete",completeF);
sound2.play();
function completeF(){
sound2.play();
}
this.closebutton.addEventListener("click", son);
function son () {
createjs.Sound.stop("music2");
}but it does not change anything, sound1 cuts out too and I can't loop the sound1.
Thank you for your help.
