The most common type of flies that infest house plants are fungus gnats (Bradysia spp). These tiny dark flies breed in soil, especially if it is rich in organic matter and is frequently overwatered. Fungus gnat flies generally don't harm the plants, but can become a nuisance. Fortunately, changing some of the ways in which you care for your plants, along with an insecticide, should eliminate your house plant flies within a month.
Allow the soil to dry out between waterings. This will make conditions less conducive for flies to breed.
Clean up your house plants. Remove any organic mulch, which is decomposing in your soil. Also prune or pick up dead leaves and flowers before or after they drop. This will help reduce the fungi in which flies breed.
Spray an insecticide that contains pyrethrin or resmethrin and usually comes in an aerosol can in the soil. Repeat every two to three days for three to four weeks. Always follow the application directions on the label.