Stephan Hauduc wrote on 16 jul 2003 in comp.lang.javascript
:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29... Stephan Hauduc wrote on 16 jul 2003 in comp.lang.javascript: > What I think is the best way for me to do what I want to do is have
> a text file which contains the following, the number of slides at
> the top, then the time lengths that each file should be displayed
> for in the slideshow in sequence.
>
> SO what I'd like to do is have a slide show that displays files
> named as slide1.jpg, slide2.jpg to slidexx.jpg with varying times
> for each files display time as specifed in the external file.
>
> So... any ideas how I would go about this please
this depends on the platform you want to use:
serverside
read the txt file into arrays nd execute this
[sort of pseudo code, asp-vbs + client js, not ready coding]
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set ListFile = fs.OpenTextFile(FilePath, ForReading)
%>
<script>
max=<%..read.%>
n=0
<% for m=0 to max %>
imag[++n]=<%..read..%>
imagtime[n]=<%..read..%>
<% next%>
</script>
<img src="" id="photo">
<script>
n=0
nextimg()
function nextimg(){
photo.src=imag[n]
nn = n
n = (n<max)? n+1 : 0
setTimeout("nextimg()",imagtime(nn)*1000)
}
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)