They are winged beetles , and commonly called fireflies or lightning bugs for their conspicuous crepuscular use of bioluminescence to attract mates or prey .

They use flashes of light to attract mates .
