Update frame on moving sprite tile

I have a sprite that's moving, when the player interacts with the crank it changes some of the sprites tiles to a different frame, however it only shows for a few seconds and then disappears, I think it's because the sprite is moving but I'm not sure how to make it so it stays until the player uses the crank again to change back to the first frame.

Any help is appreciated. Thank you.

The swap function reinitiate the frame if you're not telling which frame to change to.

you should get the frame in a variable before swaping position with

 frame event.x,event.y

and after the moving and swap use

frame frameSprite