Some animations take time to complete so you may have to close a switch for a short period of time before the switch is read.
When a switch closer is detected, you can change the animation to the next in your sequence.
A simple State Machine can be used to switch between animation sequences.