# XML Slideshow Smooth Transition

**URL:** <https://forum.kirupa.com/t/xml-slideshow-smooth-transition/182131>\
**Category:** flash\
**Created:** [March 15, 2006, 6:11pm UTC](https://forum.kirupa.com/t/xml-slideshow-smooth-transition/182131 "2006-03-15T18:11:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saveth](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@saveth](https://forum.kirupa.com/u/saveth)\
**Post date:** [March 15, 2006, 6:11pm UTC](https://forum.kirupa.com/t/xml-slideshow-smooth-transition/182131/1 "2006-03-15T18:11:10Z")

</div>

It’s very likely this has been answered already but I searched around and couldn’t find it. Is there a way to have the images do a smooth transition (one fades out as the other fades in) with the xml slideshow piece?

Here is my current code

```auto

function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild.firstChild;
        image = [];
        total = xmlNode.childNodes.length;
        trace(total);
        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("hidden for a reason");

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 += 10;
        }
    }
};

function nextImage() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            slideshow();
        }
    }
}

function prevImage() {
    if (p>0) {
        p--;
        picture._alpha = 0;
        picture.loadMovie(image[p], 1);
    }
}

function firstImage() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        slideshow();
    }
}

function slideshow() {
    myInterval = setInterval(pause_slideshow, 3000);
    function pause_slideshow() {
        clearInterval(myInterval);
        if (p == (total-1)) {
            p = 0;
            firstImage();
            } else {
                nextImage();
                }
            }
        }

```

Thanks,  
Saveth
