Flying ants typically harbor around rotted wood so if you have any rotted wood in your home you should find it and replace the rotted wood first and then use insecticide on the new wood to kill off any new flying ants.
Before you replace the rotted wood it's a good idea to spray insecticide on the rotted wood where the flying ants harbor so it will kill the flying ants or sprinkle boric acid on and around the rotted wood or use bakers yeast to kill the flying ants.
Lemon Juice or Peppermint oil can also kill off and get rid of flying ants in your home and Mint also acts as an ant repellent.