Hello, I don't know what happened but my canvas animation run very fast after I press go back button (gotoAndPlay(0)).
My animation contains sounds, graphics (draw circle, line...), linkages and preload.
Preload load all images and sounds. First part is animation with sound, second part have graphics, linkages.
I have a "Go back" button that allowed to play from the start of first part. And "Go next" that jump straight to second part.
1st run is good. Sound start after each other, animation run at 30FPS. Go next button also run good.
But when I press go back button and play again from frame 0, everything faster than before, sound start even when the previous one haven't end.
I tried looking but found nothing. Please help.
It is quite possible that when you press the back button events are being added again and instances added at runtime are not being removed in the way you expect.
Can you verify this?
Yes, that's might be a problem since I have my code in various frames.
Is there anyway to fix it other than put all code in frame 0?
I would have to see your code. Do you mind providing it?
Sorry for late reply, due to some security, I can't send you the file. However, I will try to make a simple file for you.
Amazing tutorial! Thanks a lot! Haha Very good.
What I did was to check in each frame if the code has already run or not, preventing multiple event listeners of the same type from being added to the same instance.
Please let me know if it's working now.
Thanks JC, this work like a charm. I will apply it to the rest of my file.