I am developing a game which has a timer bar running across the screen while playing. When the game ends I want the timer bar to stop running. I have the following animation:
var startAnimation = Ti.UI.createAnimation({ right: "0dp", duration: 20000, curve: Titanium.UI.ANIMATION_CURVE_LINEAR }); //Animate progress bar $.timeGoalProgress.animate(startHighscoreAnimation);Which I want to overwrite with:
var stopAnimation = Ti.UI.createAnimation({ right: "100dp", duration: 1 }); $.timeGoalProgress.animate(stopAnimation);But the duration of the animation is not overwritten by the second duration. What happens now is that the right value is replaced by the new right value, but the duration stays 20000.
Does anyone know how to overwrite the duration of an animation?
I use SDK version 3.5.1 and I am developing for iOS.