Marty1963 Newbie Poster

I'm trying to reuse an old Flash file that my client wants on his website however I'm using Flash CC now, and the existing code does not funtion in ActionScript3. I can't see why this won't work. Any advise would be greatly appreciated

function randRange(min:Number, max:Number):Number {
    var randomNum:Number = Math.round(Math.random()*(max-min))+min;   
    return randomNum; 
}     
var myFrame; 
myFrame = randRange(2,7); 
gotoAndStop(myFrame);