Highlighted

Slideshow with adl

New Here ,
Oct 22, 2019

Copy link to clipboard

Copied

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>

Views

52

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Slideshow with adl

New Here ,
Oct 22, 2019

Copy link to clipboard

Copied

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>

Views

53

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 22, 2019 0
malre LATEST
New Here ,
Oct 24, 2019

Copy link to clipboard

Copied

hey everyone !!

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

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 24, 2019 0