/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function randomNumber(low:int = 0, high:int = 0):int{ var low:int = low; var high:int = high; if(low == high) throw new Error("low & high value must be the same"); return Math.round(Math.random() * (high - low)) + low; }