I cut a plastic water bottle in half..put some fruit in it and the cover the open end with a sandwich bag and seal it with a rubber band ..poke some half to inch siZe holes in bag and you will trap all the flies..works like a charm
The really small flies are the fruit fries and they at times come if there is garbage around. Another reason is when there are some foods around, if fruit juice or fruits can also cause them to appear. If want to get rid of them you can check http://www.wikihow.com/Get-Rid-of-Fruit-Flies.
-fruit flies. and they come all the time, they come if you leave out things like milk, fruit, usually if the fruit is cut open and left out. if you have frogs or lizards, you could catch them and feed them to them :)