/ Published in: ActionScript 3
Functions that returns a number between min & max, as integer or decimal.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function getRandInt(_min:Number, _max:Number):int { return _min + Math.round(Math.random()*(_max - _min)); } public function getRandNum(_min:Number, _max:Number):Number { return _min +Math.random()*(_max - _min); }