Get a Random Number Within a Specified Range Using AS3

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

We often need to use a randomly generated number for certain situations; using Math.random() * n will usually do the trick, but it will only calculate a number from 0 to n. What if we need a number that doesn’t give 0 as the minimum value? How can you generate a random number between 100 and 1000? I’ll show you how to do it in this Quick Tip.

http://active.tutsplus.com/tutorials/actionscript/quick-tip-get-a-random-number-within-a-specified-range-using-as3/

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>