How to get an animation to play only one time for every click on a button ?

M.E shared this question 1 year ago
Answered

I have a button that start an animation.

By clicking on the button, I would like the animation to be played only one time.

And I want this to happen every time I click on the button.

I have tried to set the animation to only get repeated once. But then it seems I can't turn the animation on again when I click on the button which should turn the animation on.

I would therefore like to hear how I can get an animation to be played only one time every time I click on a button that turns it on ?

Comments (2)

photo
1

an example in the attachment

Works similar for sliders but need no pathParameter, instead the value min or max can give direct wirh SetValue(<slider>, value)


Note 1: quote: "But then it seems I can't turn the animation on again when I click on the button which should turn the animation on."

you must set the the animated object to the min-value / initial-value and then you can start the animation.


Note 2: the variable "speed" in the properties speed of B suppress in the bottom-left the pause-button

photo
1

Arh, now I get it. Thanks a lot.

I have just written "StartAnimation( )" (as it says here) instead of StartAnimation[ Object, Boolean ]. When using this version, there's no problem. :)

photo
© 2019 International GeoGebra Institute