Griffith Designs

AS2 Random Number Generator

by webmasterjunkie on Sep.26, 2010, under Actionscript, Programming

I remember having to scour the Internet in order to get the code pieced together just right in order to do this. So, in case you were looking, here you go.

1
2
3
function get_random (lowNumber:Number, highNumber:Number):Number {
	return Math.ceil (Math.random () * (highNumber - lowNumber + 1)) + (lowNumber - 1);
}
:, ,

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Connect