Ugh...We are currently having a problem with fruit flies. I first noticed them about 2 weeks ago and had no idea where they were coming from.
There were a ton of them hovering around the trash can so I of course, took out the trash, sprayed a disinfectant/deodorizer in the trash can, and mopped the floor paying special attention to the area the trash can is in. That didn't help. I was going crazy trying to figure out where they were coming from until one day I noticed a TON of them in our front room (that room doesn't get used much since our couch and TV are in the family room in the back of the house).
I finally tracked them down to a table we have in the front room that has a sort enclosed of shelf under it. The kids use that table when they play and they have a lot of drawing paper in that shelf. I couldn't figure out why on earth that table would be attracting the flies because we never take food in that room. I went through the shelf anyway and found, behind all the papers and crayons, my son had gotten into a bag of frozen fruit that was in the freezer, and, instead of throwing the bag in the trash, he stuffed it in that table
Well, that was it, that was what was attracting them. By that time, however, there were so many fruit flies that I didn't even want to cook because of all the stupid little flies hovering about. I talked to my mom to see if she knew of anything that would get rid of them and she looked online and found that mixing apple cider vinegar with a little bit of water in a jar attracts the flies, and, adding dishsoap to it makes it impossible for the flies to escape the jar. Well, I don't have any apple cider vinegar, so she kept looking. Eventually she found that fruit flies are also attracted to beer. I did have that!
I opened a can of beer, poured a little in a few jars, added a bit of dishsoap and bam, in 2 days over 50 of those suckers were gone. There are still a few here and there but not nearly as many as there were! I need to put some more beer in the jars, but, I'm down to my good beer (Blue Moon and Sunshine Wheat...lol) and I really don't want to waste my last 2 good beers on fruit flies!
If it's house flies you have, I'm not sure if the beer will work. I have read, however, flies don't like the smell of cloves and adding cloves to an apple or orange will deter them.