hard to say without more info on the fly. Most hydro stores and hardware stores carry a no-pest yellow paper. You can try using that if the flies are temporary. If the flies figure out how to next in your soil, then you will need to treat the soil with neem oil which is non toxic and sold in the same stores including wal-mart.