How to save output

I am now editting a lottery program by using actionscript, so I must output the results to a external file to show my justice and the exactness of the results!
So can you give me some examples about how to output the results?
Meanwhile I will try my best to do that!