I am not too sure about a GoTo.... I thought they were now considered bad programming practise?
But this may be of help...
In head...
var runner = new Array(6);
var curRunner = 0;
var startRunning;
runner[0] = "runner0.jpg";
runner[1] = "runner1.jpg";
runner[2] = "runner2.jpg";
runner[3] = "runner3.jpg";
runner[4] = "runner4.jpg";
runner[5] = "runner5.jpg";
function marathon() {
if (curRunner == 5)
curRunner = 0;
else
++curRunner;
document.animation.src = runner[curRunner];
}
In body....
<img src="runner0.jpg" name="animation">
<form>
<input type="button" name="run" value=" run " onclick="startRunning=setInterval('marathon()', 100);">
<input type="button" name"stop" value=" stop " onclick="clearOnterval(startRunning);">
</form>
So...
You refer to the source of an image in your javascript which will cycle through the images in an array at an interval of 100
Hope this was some help, if you could help me I posted one called "changing text onClick()"
Leigh
Leigh Halliday - Student Programmer
Bookmarks