Thread
:
ActionScript Tips Thread
View Single Post
Codemonkey
2006-11-05 #
13
011 - Quick random number
If you quickly need a random number in a certain range, then you can use this simple (util) function:
ActionScript Code:
function
randomNum
(
min
,
max
)
:
Number
{
return
min
+
Math
.
round
(
Math
.
random
(
)
*
(
max
-
min
)
)
;
}
Codemonkey
View Public Profile
Visit Codemonkey's homepage!
Find all posts by Codemonkey