Flying ants not more dangerous than the crawling types. Actually it can be off-putting to have a cloud of flying ants settle in your hair and clothes, but they do not cause any real harm. Console yourself with the thought that they may well be on the way out of your garden in any case.
Most ant colonies consist largely of wingless workers, but during warm and muggy summer weather, winged males and females are produced. When enough of the winged insects have grown, some instinct triggers the desire to swarm. For several hours before takeoff, the winged insects will be running round outside the nest. Then they will join in a mating swarm and follow the queen ant to find a new site.
So if you want to be neighbourly and prevent the ants from making a nuisance of themselves in the garden next door, those few hours are the time to act. Spray or dust around the nest and over the excited ants before they take to the air.