|
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] = "http://localhost/cam2images/snap.jpg"; //storing dead paths
mypics [1] = "http://localhost/cam2images/snap1.jpg";
mypics [2] = "http://localhost/cam2images/snap2.jpg";
mypics [3] = "http://localhost/cam2images/snap3.jpg";
mypics [4] = "http://localhost/cam2images/snap4.jpg";
<!--
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="/forum/cam2images/snap.jpg" id="idofyourimage" width="600" height="480" />
<script type="text/javascript">
<!--
setTimeout("refreshImage()",1000);
//-->
</script>
</body>
</html>
|
|
|
|
|
|
|
// |