How do I make a dice code?

My math quizz cousin has decided today to make a Flash Version of the ever popular ( and expensive) game called " CashFlow".

He opened Flash for the first time today.

I’m looking for a dice tutorial that shows how to press a button and a number between 1 and six appears.

ps: My cousins a math genius, he was asked to work at NASA to design rockets, but instead he’s gonna be a math teacher. SO I know he can do it.