Click to See Complete Forum and Search --> : array threw avi's


Code One
11-15-2003, 05:23 AM
Hello,
I'd like to array threw 3 .avi files, and have a next and previous feature, that way I can keep it all on the same page. I'm not to sure how to array threw movie files, or to setup the next and previous script. I've already searched all over for a solution, but I can't find anything. Any help?

regards,

code one

Jona
11-15-2003, 12:15 PM
Untested code...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Videos Gallery</title>
<script type="text/javascript"><!--
vids = new Array("video/vid01.avi","video/vid02.avi","video/vid03.avi");

var num = 0; // start at first one

function next(objID){
num++;
if(num>=2){num=0;}
document.getElementById(objID).src=vids[num];
}

function prev(objID){
num--;
if(num<0){num=7;}
document.getElementById(objID).src=vids[num];
}
//--></script>
</head>
<body>
<div><object src="video/vid01.avi" id="pgVid"></object>
<script type="text/javascript"><!--
document.write("<p><button onclick=\"prev('pgVid');\">Previous</button> | <button onclick=\"next('pgVid');\">Next</button></p>");
//--></script>
</div>
</body></html>


[J]ona