You'll need a server-side scripting solution...PHP, ASP, etc...then you use loadVariables to send info from Flash out to the php script...
Here's a basic php script to get you started...this will write all variables in your flash movie into the text file test.txt. The SWF file, test.txt, and the php script file should all be in the same directory for this to work...
$fp= fopen($data, "w+");
Hope this helps,