I like that trap idea! I've used apple cider vinegar to lure them, too.
It's key to find the source of the flies. Our compost crock gets flies sometimes when the weather is warm and I don't dump it outside often enough. Last summer I was so frustrated that dumping it frequently wasn't getting rid of the flies...until I realized that I was bringing the flies in from the compost heap inside the crock! They were flying in when I dumped it and then riding into the house. Now I check the crock and/or do a quick rinse before taking it back in. No flies yet this summer.