“Prefetch”
means to get the images and save them in (our own) array so they are handy to
assign to doc.i
•We
must declare an array (and probably an index variable, too):
•
var i, pref = new Array(4);
•Then
we set it up to hold images:
• for
(i=0; i<4; i++) {
•
pref[i] = new Image;
•
}