Make a spray solution of water with a small amount of regular Dawn in it. Spray on and it will kill the flies. It is safe for plants. I make a big batch of this and spray my entire garden with it. Kills the bugs already there and keeps away most others. I've done this every year without having any issues to my plants. If you prefer a more natural way put some garlic powder and a few cinnamon sticks around your plants. For some reason bugs don't like the smell of these two and usually leave. Even works for ants.