# Modifying slideshow tutorial: is it possible to crossfade images?

**URL:** https://forum.kirupa.com/t/modifying-slideshow-tutorial-is-it-possible-to-crossfade-images/193514
**Category:** flash
**Created:** [July 13, 2006, 8:06pm UTC](https://forum.kirupa.com/t/modifying-slideshow-tutorial-is-it-possible-to-crossfade-images/193514 "2006-07-13T20:06:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![renee](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@renee](https://forum.kirupa.com/u/renee)
#### Post date: [July 13, 2006, 8:06pm UTC](https://forum.kirupa.com/t/modifying-slideshow-tutorial-is-it-possible-to-crossfade-images/193514/1 "2006-07-13T20:06:20Z")

</div>

I am building a modified version of a slideshow, using the code from a tutorial: [http://www.kirupa.com/developer/mx2004/xml\_slideshow.htm](http://www.kirupa.com/forum/../developer/mx2004/xml_slideshow.htm)

What I am wondering is if it is possible to cross fade the imagery so that the images don’t just fade in, jump to the next image and fade in. Here is the code I’m working with from the tutorial.

* * *

delay = 5000;  
//-----------------------  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
/////////////////////////////////////

## p = 0; this.onEnterFrame = function() { filesize = picture.getBytesTotal(); loaded = picture.getBytesLoaded(); preloader.\_visible = true; if (loaded != filesize) { preloader.preload\_bar.\_xscale = 100\*loaded/filesize; } else { preloader.\_visible = false; if (picture.\_alpha\<100) { picture.\_alpha += 3; } } }; function nextImage() { if (p\<(total-1)) { p++; if (loaded == filesize) { picture.\_alpha = 0; picture.loadMovie(image[p], 1); picture\_num(); slideshow(); } } } function prevImage() { if (p\>0) { p–; picture.\_alpha = 0; picture.loadMovie(image[p], 1); picture\_num(); } } function firstImage() { if (loaded == filesize) { picture.\_alpha = 0; picture.loadMovie(image[0], 1); picture\_num(); slideshow(); } } function slideshow() { myInterval = setInterval(pause\_slideshow, delay); function pause\_slideshow() { clearInterval(myInterval); if (p == (total-1)) { p = 0; firstImage(); } else { nextImage(); } } }

I would really appreciate some help or an opinion from someone who can at least take a look and tell me if this is possible. Thanks!!!
