How do i make flash create an external .txt file

ok lets say i have a dyn. text box called text1. when u enter stuff, how do i make the chars that u entered look like this ‘’ ? when i click a button (but1) then it will create an external .txt with the text u entered in ‘text1’ but without the '’ shapes… and then once u click the buttons i want the flash .swf to close itself. plz help me with this! :tb: