I’m trying to move a series of dots (mc used as linkage: “Dot”) within a frame to random targets, with the movement activated by onRollOver. This part I have working fine. The part I’m having difficulty with is getting the objects to have target coordinates to move randomly, except rounded to the nearest 12 pixels. Any ideas? Thanks in advance.
Here’s the relevant code:
minx = 120;
maxx = 450;
miny = 20;
maxy = 60;
function randx() {
var x = minx+Math.round(Math.random()*(maxx-minx));
return x;
}
function randy() {
var y = miny+Math.round(Math.random()*(maxy-miny));
return y;
}