First, select the sprite's animation you want to configure, then on the properties panel, set the speed to 0. Then in the event sheet, create an event for "On collision with another object", and depending on what you want to achieve, add the following actions from the "Animation" category:
- If you want to switch to the 2nd frame and stop there, just use the "Set frame" with index 1.
- If you want the animation to play, use the "Set speed" action.