I'm thinking that these are commonly known as fungus gnats (Janet are all Sciaridae fungus gnats?), in which case I'm also thinking spraying the plant outside isn't necessarily going to help because fungus gnats live outside, they tend to come indoors with plants that were outside for the summer (or I once brought them home from a "big box" hardware store's garden centre in the soil of a plant).
If you have them flying around you most likely also have the larvae in the potting medium as well that won't be affected by a foliar or aerial spray. As Janet said, being careful with the watering should help. Of course if you can get rid of the adult flies indoors eventually the larvae in the soil will be gone too, but it's the larvae that do the most direct damage to plants, although the adult flies are a nuisance and can carry some diseases to the plants.