Yes, flash has a few very helpful Math functions that allow you to do a lot of different things with numbers. If you're using AS 2.0 Math.random() takes a random number 0 - whatever you want, in your case it would be:
Math.random() * 6
But if you're using AS 3.0 I'm sure the tutorial above would help