I do a variation of what joecaption said. I take a bowl and put about a cup of vinegar in it. Then I put some plastic wrap tightly over it and punch several small holes in it. The flies are attracted to the vinegar and they can get in but can't get out. Works like a charm for me.