Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

Generate Random Number


function randomRange(max:Number, min:Number = 0):Number
{
return Math.round(Math.random() * (max - min)) + min;
}

trace(randomRange(5)); //Outputs number between 0 and 5
trace(randomRange(10,1)); //Outputs number between 1 and 10

0 comments:

Post a Comment