Figured out how to animate the dot using a timer. Also, instead using a for-loop, I used setInterval:
function animate(){
var pt = oldLoc, i = 0, timer; // no global variables declared...
timer = setInterval(function () {
pt.y += 20;
pt.x += 20;
graphic.setGeometry(pt);
graphic.show();
//dojo.byId("info").innerHTML += "testingcheck";
if (i >= 1000) { // stop condition
clearInterval(timer);
}
i++;
}, 5);
}
And Happy Spring Break!
No comments:
Post a Comment