We Recommend

HTML Dog: The Best-Practice Guide to XHTML and CSS HTML Dog: The Best-Practice Guide to XHTML and CSS
For readers who want to design Web pages that load quickly, are easy to update, accessible to all, work on all browsers and can be quickly adapted to different media, this comprehensive guide represents the best way to go about it.


Posted By

Wiederkehr on 04/02/08


Tagged

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.