Im not sure the exact code to do this, but it should be easy enough to find. In flash you can call javascript functions on the html page its self. This is usually used to create popups e.g.
http://www.flash-db.com/PopUp/JavaScriptPopUp.php?page=1, then you could simply change the popup script to window.close();
If you need any more detail just shout.
Flabby Rabbit