Causes of sudden blurry and hazy vision that goes in and out?

Spasm. Sounds like accommodative spasm, where the focusing muscle of your eye is "spazzing out". If you are older, could be a sign of stroke- depends if it's one eye or both. You need to see an ophthalmologist.