Sets the flag that determines whether the animation should be replayed.
If the flag is true, the animation is replayed instantly, otherwise the animation stops when it is finished.