I have the same problem time ago, It's really simple in your event :
-player on collision with sprite
you just have to add another condition
then use right click and select invert
so when your player is not flashing and collides with the obstacle it will dealt damage
and if it's still falshing it will not do damage