I have an animation that i would like to speed up and slow down with a button click. I've looked around quite a bit and cant find a solution. Currently I have an actionlistener for the button that changes the value of the delay variable and restarts the timer.
Can anyone please advise. Thanks
Rather then changing the timer, which other parts of your animation might rely on, I would change the speed of the object.
This is little subjective. My example has an object capable of changing speeds over the same period of time. You may actually be required to alter how long the animation plays for instead, which will require a change in the time. This brings up other issues.
One way to achieve this is, is to actually have a timer that ticks at a regular interval and a model that reacts to those ticks. This means that if you adjust the duration, the heart beat won't be effected, you'd just need to adjust the distance through the animation. This is how the Timing Framework works and I believe Trident follows a similar design