Copy link to clipboard
Copied
Hello,
I have an interactive HTML5 Canvas component built in Adobe Animate with a number of labelled "pages" on the timeline. On each page there are a number of options to choose which page to move to (using gotoAndPlay) so there a few 'routes' through. This is all working fine, but what I am struggling with is this: I would like a "Go Back" button that would take you back through the route you have chosen. I'm guessing this would involve recording a list of variables but my coding skills aren't robust enough. Any suggestions would be appreciated?
Many thanks!
Somewhere in your initialization section...
myHistory = [];
In your navigation button handler...
myHistory.push("name of the label that's being navigated to");
In your back button handler...
this.gotoAndPlay(myHistory.pop());
Copy link to clipboard
Copied
Somewhere in your initialization section...
myHistory = [];
In your navigation button handler...
myHistory.push("name of the label that's being navigated to");
In your back button handler...
this.gotoAndPlay(myHistory.pop());
Copy link to clipboard
Copied
That's great, thank you. I'm implementing it at the moment but it looks like it's working. Thank you!
Copy link to clipboard
Copied
It works! Thanks again.