**Question :: How do you generate random numbers within a given limit with actionscript?**

Answer :public function randRange(min:Number, max:Number):Number {

var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;

return randomNum;

}

Answer :public function randRange(min:Number, max:Number):Number {

var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;

return randomNum;

}

Subscribe to:
Post Comments (Atom)

## No comments:

Post a Comment