What you're describing could be a
posterior vitreous detachment (PVD). The vitreous is a gel-like substance we have inside our eyes, which is attached to the retina. When this gel falls (or detaches) from the retina, mainly due to age, we can experience
floaters of sudden onset and some flashes of light. This last symptom is due to the gel "pulling" on the retina and exciting the photoreceptors.
It is highly advisable to undergo a dilated eye examination as soon as possible, in order to evaluate that the periphery of the retina is in place, and to rule out any pathologies such as
retinal tears, holes or detachments. Although PVDs only need follow up, the best outcome for retinal tears, holes and detachments happens the soonest they are treated. Other symptoms you should also evaluate (and which mean that medical care is highly advisable) are if you saw something similar to "rain falling down"; if you see a curtain/shadow with that eye; if the vision is less than normal, and if you received a hit on the head or sudden movement before presenting the floaters.
In conclusion, to rule out more serious conditions (and for peace of mind), it would be ideal to seek medical evaluation by an Ophthalmologist.