How can I set positions of multiple images on canvas within a loop? The following seems to work with:
for (var i=1; i<10; i++) {
images[i]=new Image();
images[i].onload = function() {
drawImage(this, 1, 1, i*50, 700, "bulb"+i);
// THE POSITION CANNOT BE SET ; i IS ALWAYS 500
}
images[i].src = folder+src[i];
}