Hi guys,
I'm having some trouble executing my script and I'm not sure where I am going wrong.
It for a webcam - The web cam captures 5 images a second and is saved into a directory, (only 5 images) and the 5 images gets over written every 1 second.
The script needs to read in sequential order 1-2-3-4-5 and loop back, refreshing the images.
I hope someone can help.... Thanks in advanced.
<html>
<head>
<script type="text/javascript">
var mypics = new Array(); //making a new array
mypics [0] = " //storing dead paths
mypics [1] = "mypics [2] = "mypics [3] = "mypics [4] = "
<!--
function refreshImage()
{
var img = document.getElementById('idofyourimage');
i=integer; //integer value...
for (i=0;i<5;i++) // makes it loop through array with pointer of i;
{
img.src=mypic;
}
setTimeout("refreshImage()", 4000);
}
//-->
</script>
</head>
<body>
<img src="cam2images/snap.jpg" id="idofyourimage" width="600" height="480" />
<script type="text/javascript">
<!--
setTimeout("refreshImage()",1000);
//-->
</script>
</body>
</html>
I'm having some trouble executing my script and I'm not sure where I am going wrong.
It for a webcam - The web cam captures 5 images a second and is saved into a directory, (only 5 images) and the 5 images gets over written every 1 second.
The script needs to read in sequential order 1-2-3-4-5 and loop back, refreshing the images.
I hope someone can help.... Thanks in advanced.
<html>
<head>
<script type="text/javascript">
var mypics = new Array(); //making a new array
mypics [0] = " //storing dead paths
mypics [1] = "mypics [2] = "mypics [3] = "mypics [4] = "
<!--
function refreshImage()
{
var img = document.getElementById('idofyourimage');
i=integer; //integer value...
for (i=0;i<5;i++) // makes it loop through array with pointer of i;
{
img.src=mypic;
}
setTimeout("refreshImage()", 4000);
}
//-->
</script>
</head>
<body>
<img src="cam2images/snap.jpg" id="idofyourimage" width="600" height="480" />
<script type="text/javascript">
<!--
setTimeout("refreshImage()",1000);
//-->
</script>
</body>
</html>