var description = new Array("blank", "triangle", "circle", "square"); var pictures = new Array(3); var counter = 0;
function initialize(){ // sets up the array with some startin values // Andy Harris pictures[0] = new Image(50, 50); pictures[0].src = "blank.gif"; pictures[1] = new Image(50, 50); pictures[1].src = "triangle.gif"; pictures[2] = new Image(50, 50); pictures[2].src = "circle.gif"; pictures[3] = new Image(50, 50); pictures[3].src = "square.gif";
} // end initialize
function upDate(){ //increments the counter and shows the next description counter++; if (counter > 3){ counter = 0; } // end if document.imgDisplay.src = pictures[counter].src; document.myForm.txtDescription.value = description[counter]; } // end upDate