HTML5 Audio Control
Hello, I am trying to control audio and timeline in an HTML5 document in Animate. My Pause and Play buttons are not working correctly. They work for the timeline but not the audio. In my main Scene 1 timeline I have an mc named S2. On my Actions layer in frame 1 of S2 I have:
var soundS2 = createjs.Sound.play("mysound");
soundS2.play();I then have another 1-frame mc called Nav that holds the navigation and control buttons on another layer in S2. On frame 1 of Nav I have:
this.pause_btn.addEventListener("click", fl_MouseClickHandler_4.bind(this));
function fl_MouseClickHandler_4(){
this.parent.stop();
this.parent.soundS2.pause();
}
this.play_btn.addEventListener("click", fl_MouseClickHandler_5.bind(this));
function fl_MouseClickHandler_5(){
this.parent.play();
this.parent.soundS2.play();
}
When launched the sould plays, but it does't pause. The timeline, however, will pause and play. I saw on another post that if I make an instance of the createjs.Sound.play("mysound"), that I can control the instance with a pause() and play() functions.
My end result would be to have both the sound and timeline pause, then start at the same spot when the user click the play button.
Any help here would be greatly appreciated.
Thank you!
