Copy link to clipboard
Copied
Hi there,
I'm very new to the coding side of animate, and am struggling well out of my comfort zone 😄
I've made a digital interactive picturebook dummy, with buttons to go forward and back, as well as an interactive turning wheel to demo what the picturebok interactivity would be. When the user gets to the last page (frame), and clicks on the back to the start button, I'd like the user to be able to run through the book again. Currently on the last page I'm using:
var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.nextbutton.on('click', function(){
/*
Moves the playhead to the specified frame number in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
*/
_this.gotoAndStop(0);
});
And we do go back to the first page, but none of the buttons work any more so we're just stuck on the front cover again.
how do I create a loop please?
Copy link to clipboard
Copied
you have to be careful to not repeat code that was previously used and still active. that's most likely what's causing your problem.
you can get more info by opening your browser's developer console.
lesson 1 - https://youtu.be/PBDQN9CQSeI
lesson 2 - https://youtu.be/KJEl0OenGUY