flash random number code

Math.floor(Math.random() * 5). This equation will generate a random number between 0 and 4, if you want 1 -5 you simple add 1 to the end of the equation. The multiplier is the key, if you want to generate a random number between 1 and 99 you would simple change the 5 to 99 and add 1 to the end of the equation.
 
Do you mean 0 or 1 or 0.....1 ?

AFAIK they would be Math.Round(Math.Random()) or just Math.Random()

Haven't touched Flash for years but it seems weird if there isn't a random integer method.
 
Last edited:
Back
Top Bottom