How can I create an array of images?
why won't this work?
Img = new Image()
Img[1].src = "1.jpg"
Img[2].src = "2.jpg"
Img[3].src = "3.jpg"
Printable View
How can I create an array of images?
why won't this work?
Img = new Image()
Img[1].src = "1.jpg"
Img[2].src = "2.jpg"
Img[3].src = "3.jpg"
like this:
Code:var imageArray = new Array(5)
imageArray[0] = new Image()
imageArray[0].src = "images/white.gif"
imageArray[1] = new Image()
imageArray[1].src = "images/black.gif"
imageArray[2] = new Image()
imageArray[2].src = "images/red.gif"
imageArray[3] = new Image()
imageArray[3].src = "images/green.gif"
imageArray[4] = new Image()
imageArray[4].src = "images/blue.gif"
That definatly helps thanks!