thats not a local variable; you are assigning index "i", of the inherited scope/routine scope/public scope array "preload" to reference a new Image object, which is automatically var'd and scoped by that assignment (infact, you'll find that Image isn't accessible by any scope; its scope sort of disapears, and it can only be accessed through the array)
If you were doing this:
for (var i = 0; i < array_name.length; i++) {
var thisImage = new Image();
thisImage.src = array_name[i];
preload[i] = thisImage;
}
then you'd need (or should use) the var.
Last edited by MattEvans; Nov 29th, 2006 at 6:02 pm.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
Offline 1,091 posts
since Jul 2006