Why do nocturnal insects fly towards/into the light?

if they are nocturnal shouldnt they fly away from the light. ive seen a theory that says its because they use the light from the moon guiding them but if that is the case and they think the lights are the moon why do they fly into the light, shouldnt they as well fly up towards the moon until they die of lack of... show more if they are nocturnal shouldnt they fly away from the light. ive seen a theory that says its because they use the light from the moon guiding them but if that is the case and they think the lights are the moon why do they fly into the light, shouldnt they as well fly up towards the moon until they die of lack of oxygen then too?
3 answers 3