Hi,
I've been trying to write something to simplify the preloading for my buttons. There are two button states and they are named button.gif and button_o.gif (where button is a unique name for the button). So the code needs to introduce button as a new image and set the source property. But it doesn't! Any help much appreciated.
I've been trying to write something to simplify the preloading for my buttons. There are two button states and they are named button.gif and button_o.gif (where button is a unique name for the button). So the code needs to introduce button as a new image and set the source property. But it doesn't! Any help much appreciated.
Code:
navImgs =
["commit","contact","dates","draw","entry","finals","links","results",
"rules","scores","teams","winners"]
buttons = new Array()
buttons_o = new Array()
for (i in navImgs)
{
buttons[i] = new Image
buttons_o[i] = new Image
buttons[i].src = "images/" + navImgs[i] + ".gif"
buttons[i].name = navImgs[i]
buttons_o[i].src = "images/" + navImgs[i] + "_o.gif"
buttons_o[i].name = navImgs[i] + "_o"
}