Thread: Javascript help
View Single Post
Old 12-05-2008, 05:54   #7 (permalink)
crimsonkid
Registered User
 
Join Date: May 2008
Posts: 4
oh sorry, thanks

This is the file:

//animation for first demo
var timerID, num=0;
img0 = new Image (55,45);
img0.src = "0.gif";
img1 = new Image (55,45);
img1.src = "1.gif";
img2 = new Image (55,45);
img2.src = "2.gif";
img3 = new Image (55,45);
img3.src = "3.gif";
img4 = new Image (55,45);
img4.src = "4.gif";
img5 = new Image (55,45);
img5.src = "5.gif";
img6 = new Image (55,45);
img6.src = "6.gif";
img7 = new Image (55,45);
img7.src = "7.gif";
img8 = new Image (55,45);
img8.src = "8.gif";
img9 = new Image (55,45);
img9.src = "9.gif";

function startShow() {
num=num+1;
if(num==10) {
num=0
};
document.mypic.src=eval("img"+num+".src");
timerID=setTimeout("startShow()","1000");
}

function stopShow() {
num=num+1;
if(num==10) {
num=0
};
document.mypic.src=eval("img"+num+".src");
timerID=setTimeout("stopShow()","1000");
}

// one line needed here, calling the right JS method
}

The bold is what I tried myself, however it didn't do anything

Any ideas?

Thanks for your help so far
  Reply With Quote