My plants at times do the same exact thing. My PH is perfect (6.2) and my nutes are at 1000 PPM and are optimally balanced. This condition has not affected my yeilds in the past as plants with this condition produce about the same amount as plants without this condition. I notice that the plants that develope this are always closest to the 1000 Watt bulb I'm using. Are these flies fungus gnats? Tiny fruit flies, or are you talking about house flies?

Herbus