Random text generator

Hi.

I want to make a code verification form. Those forms that generate an image which you have to read and type down the code in it.
I want to have AS generate a random set of letters and numbers in an unselectable textField. That will be the generated bitmap (not a bitmap actually, but… :P). I also want that randomly generated set of letters and numbers to be written down in a variable so that i can compare the variable with the input field of the user to test if it is ok.

Does anyone know how to randomly generate that?

Thanks a lot.