Posted By

Wiederkehr on 04/02/08


actionscript random function

Versions (?)

Function: Random value between two numbers

 / Published in: ActionScript

Small function that returns a random rounded value between two given numbers.

  1. public function getRandom(_min, _max):Number{
  2. var tNumber:Number;
  3. tNumber = Math.round(Math.random()*(_max-_min))+_min;
  4. return tNumber;
  5. } // END getRandom()

Report this snippet  

You need to login to post a comment.