Posted By

Heol on 06/16/11


Tagged

random


Versions (?)

Random Function


 / Published in: ActionScript 3
 

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

  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  

You need to login to post a comment.