Sunday, 25 January 2015

random function in as3

function randomRange(minNum:Number, maxNum:Number):Number
{
    return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
}

trace(randomRange(1, 6));

out put :-