This might sound a little cooky, but this does work.
Gather a few glass jars and their lids. Poke a bunch of 1/8 inch holes in the lid, like the ones used for capturing fire flies when you were a young child. Have the punctures facing 'into' the jar, as an 'entrance' from the outside - inward.
The 'secret ingredient' is fruity wine. You don't need much, about 1/8 to 1/4 cup per jar.
The fruit flies will be attracted to the fruit scent and they become disoriented by the vapor, and then drown in the liquid. The direction of the holes enhibit their excape.
This really does the trick!