Random Function


/ Published in: ActionScript 3
Save to your folder(s)

Generate a random number using parameters.
If there is no parameters generate a number between 0 and 1.


Copy this code and paste it in your HTML
  1. public function random(min:Number=0,max:Number=1):Number
  2. {
  3. return Math.floor(Math.random() * (1+max-min)) + min;
  4. }

Report this snippet


Comments


You need to login to view comments.