Math.random()

besides Math.random(), is there another way to specify a range of numbers, say between 0-100,

A random range of numbers, or any range of numbers?

any range of number, it would all depend on the situation, for example, say i want to get a random number between -50 and 300, is there some other way to do get that number without using Math.random?

Not unless you build your own random number generator. I haven’t heard of anybody who has built one for Actionscript (of course I haven’t been looking).

If you want a random range using Math.random you can just use this function:


//Returns a random number between the two given numbers
function randRange(minNum:Number, maxNum:Number):Number 
{
	return (int(Math.random()*(maxNum-minNum+1))+minNum);
}

No. not that i know of. Just make a custom function that take the top and bottom parameters, for example:

public function rand(v1:Number, v2:Number):Number
{
var range = v2-v1;
var result = v1+Math.random()*range;
return result;
}

edit: ■■■■ you gundark!

ok thanks