View Full Version : if (preload.complete)

02-15-2006, 02:03 AM
var preload = new Image();
var img = new Image(0,0);
var preload = new Image();

if(preload.complete) {
img.src = preload.src;
function doSomething()
// execute code

How to do use this an array of images and

Meaning can if(preload.complete) be used for an array too

02-15-2006, 09:20 AM
var preloads = [new Image(), new Image(0,0)];
gives an array of images and no you cannot use the preloads.complete because the array object will not have a complete attribute. you have to loop through the individual elements