/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function getRandomPoint(rectangle){ var randomX = getRandomInteger(rectangle.left, rectangle.right); var randomY = getRandomInteger(rectangle.top, rectangle.bottom); return new Point(randomX, randomY); function getRandomInteger (min, max) { return min + Math.floor(Math.random()*(max + 1 - min)); } }