These are lights that suddenly appear and disappear. They are visible in totally dark rooms and even when your eyes are closed.
Flashing lights or phosphenes are caused by the vitreous humour pulling on the retinal walls. They occur most frequently after a vitreous detachment and are almost always accompanied by floaters. They usually disappear after a few weeks when the vitreous stops pulling on the retina.
If phosphenes do appear you should always consult a specialist to ensure that vitreous traction is not producing a hole or a tear in the retina.
The ophthalmologist will carefully check the back the back of the eye, examining the retina to ensure no damage has been caused.
If any injury were detected in the back of the eye, this would receive prophylactic laser treatment.