How do you make a button that resets to play animation again? I want to be able to press the button and play the animation again and again. Thanx ahead of time! Marty Bee
Hi,
a way to go, is to call the reset() function on a on(“complete”…) event:
your_animation.on("complete", () => { your_animation.reset(); });
Thanks jvouillon!
I am going to reveal my complete “Newbie” status. Where do I insert the script?
thanks ahead of time!
Marty
All at the same place:
parent.on("pointerdown", (e) => {
symbol.controllers.your_anim.play();
});
symbol.controllers.your_anim.on("complete", () => {
symbol.controllers.your_anim.reset();
});
In fact, you have just to make 3 drag-n-drop of your anim in the script window!
Awesomely simple!
worked like a charm!
2 Likes