Skip to main content
malre
Participant
October 22, 2019
Question

Slideshow with adl

  • October 22, 2019
  • 1 reply
  • 135 views

Good days at all!!

Today i make a little transform on code js but i have a problem with function timeout.

this code is good , also this problem is timeout stop about two picture WHY ?

<script>
var slideShowSpeed = 3500;
var crossFadeDuration = 3;
// Specify the image files
var files = air.File.documentsDirectory.resolvePath('img').getDirectoryListing(); 
var Pic = new Array();
		for (i = 0; i < files.length; i++) 
		{ 
            
			Pic[i] = "\'img/" + files[i].name + "\'";
			air.trace(i + Pic[i] + "<br/>"); 
		} 
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) 
{
preLoad[i] = new Image();
preLoad[i].src=Pic[i];
}

function runSlideShow()
{
if (document.all) 
{
    
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="revealTrans(Duration=2,Transition=12)";
document.images.SlideShow.style.filter=
"blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src=preLoad[j].src;
if (document.all) 
{
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;


t = window.setTimeout(function(){'runSlideShow()'}, slideShowSpeed);
}
</script>
    This topic has been closed for replies.

    1 reply

    malre
    malreAuthor
    Participant
    October 24, 2019

    hey everyone !!

     ok this nice today i find error script and to change with setInterval so

    t = window.setInterval(function() {
        runSlideShow();
    }, slideShowSpeed);