I made a custom random function in case you are looking for a random number generator in Actionscript. Actionscript has a random number function but it does not really allow you to specify a minimum and maximum range. Here is the code:
private function getRandomNumber(min:int, max:int):int
{
var xRandomNumber:int;
xRandomNumber= Math.floor(Math.random() * (max -1)) ) + min;
return(xRandomNumber);
} // getRandomNumber
private function getRandomNumber(min:int, max:int):int
{
var xRandomNumber:int;
xRandomNumber= Math.floor(Math.random() * (max -1)) ) + min;
return(xRandomNumber);
} // getRandomNumber
Comments