I think it depends on what kind of fly you are talking about.
Common houseflies do not harm plants in general. They may be attracted to the flowers scent, but no food is there for them, unless there is something decaying on the ground nearby. They can't chew, so the plants are safe.
Other kinds of flies may be a problem, such as whiteflies. These can be controlled by using insecticidal soap or neem oil, sprayed on the infested plant. Normally you would find these on the leaves rather than on the flowers though. Keep in mind that these sprays will affect beneficial insects as well.