Do you have live plants? Sometimes they can come from the soil. Try taking the plant out and pouring soapy water in the soil, and rinsing it well. Sometimes that works and sometimes it doesn't.
yes i do actually, ive got one hibiscus, one ficus, and some sort of palm i picked up at an expo. wouldnt pouring soapy water on the soil kill the plant?
I have found the best cure (if it works) for me, is soapy water as others have said. Yu can also set out a few very shallow containers of sugar-water, which also seems to attract flies. This will cause them to drown. Another thing to do is repot your plant, and cover the top with rocks. Some gnats will lay their eggs in the top few inches of soil. White gnats lay their eggs on the underside of leaves, it seems they like hibiscus the most. Anytime I have a hibiscus that is infected, I return it. I am never able to rid them off of those. Hope this helps you some good luck.