[AS3] Create a random number within a range


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



Copy this code and paste it in your HTML
  1. var rand:Number = Math.random();
  2. var max:Number = 10;
  3. var randInRange:Number = Math.round(rand * max);
  4. trace(randInRange);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.