Active ingredients of most fly sprays are permethrin and tetramethrin. Which act on the nervous system of flies.
Fly spray should be used indoors, and each room of the house sprayed should have its windows and doors shut.
This article is a stub. You can help Wikipedia by fixing it.