I have an animated HTML Canvas that I produced in Animate cc
The whole thing ran well with all audio playing in sync to the animation.
But I needed to load it from a random point, which I accomplished using the following code:
this.gotoAndPlay(1+Math.random()*3456);
Every animation plays smoothly for the duration of the 5 minute timeline in the published html canvas.
But now none of the sounds are playing except for the one loaded at frame 0
So for example..
this.frame_0 = function() {
playSound("windy",-1);
}
That is the code which loads the first sound, which is on the same frame as the load a random frame code.
Now if frame 130 is loaded, and the animation plays then the following code
this.frame_143 = function() {
playSound("TrainSoundwav");
}
Should load the train sound once frame 143 is reached.
But it isn't and none of the other sounds for the entire remainder of the animation are playing in the published canvas.
I've spent hours trying to find a way to play the sounds, but nothing has worked,
Only when I remove the load a random frame code does all the audio work on publish.
I bet it is something simple I am missing,
Please help.