You don't have to buy a flight ticket before you apply for a visa. Instead, you can present a flight itinerary which you can book without paying the full price of the travel ticket and once you obtain your visa you can purchase the real flight ticket.