My guess is that the procedure is being called more than once - probably every time the frame updates. In the procedure you keep resetting the AnimationStart to the first frame of the animation so even if the animation frame tries to change it gets schanged back to the first one right away.