You want to use something like Mochimedia:
http://www.mochimedia.com/
You are obviously trying to generate a revenue source of some type so you might be interested in checking out Flashgamelicense:
http://www.flashgamelicense.com/
Which will likely net you more money than your game's entire lifespan, even if it's only $100.
Overall, this is a thick issue with Flash developers, whether to go free with ads, freemium with buyables or sell to a portal site through flashgamelicense. Overall, not many people have reported good revenue with ads because of the required number of hits to generate reasonable revenue for time worked. If you're still adamant about doing ads, mochimedia is the way to go.
As an aside, if you try to put the ads IN game instead of just on the loading of the game, I can't imagine too many people will want to play it as players are pretty good at picking up on games made for the sole purpose of revenue. Most companies, even with larger MMO based games use ads outside the flash game on the site itself, as there is more support for doing such a thing.
EDIT: As for actually putting the ads in game, you'll want to pull them randomly from a database on your end via a webservice. Many people use PHP for such a thing but possibly Python as well if you want to figure out how to write a webservice in it.