There are several methods you could try which keep insects, including flies, out and away from your tent. You could apply citronella or lavender oil to your skin or clothes, or use a diffuser or coil if you would rather not put anything on yourself.
You could even try rubbing some of the oil on your tent flaps.