# Pictures Fading in and Out

**URL:** https://forum.kirupa.com/t/pictures-fading-in-and-out/180513
**Category:** flash
**Created:** [March 1, 2006, 6:17am UTC](https://forum.kirupa.com/t/pictures-fading-in-and-out/180513 "2006-03-01T06:17:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coertli](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@coertli](https://forum.kirupa.com/u/coertli)
#### Post date: [March 1, 2006, 6:17am UTC](https://forum.kirupa.com/t/pictures-fading-in-and-out/180513/1 "2006-03-01T06:17:24Z")

</div>

So I have a site whose owner wants pitcures fading in and out on the main page. I have the code that loads the pictures and changes them every 5 seconds, but it is a quick change. How could I fade one picture in while fading another one out? Thanks for the help, and here is my code thus far:

```auto
_root.createEmptyMovieClip("pload",1);
// **************************************
//Load XML File
// **************************************
pArray=new Array();
my_xml=new XML();
my_xml.ignoreWhite=true;
my_xml.onLoad = function(success){
 if(success){
  for(var i=0; i<this.firstChild.childNodes.length; i++){
   pArray_l = this.firstChild.childNodes.length;
   pArray.push(this.firstChild.childNodes*.attributes.pic);
  }
 }
 load_home();
};
my_xml.load("pic.xml");
// **************************************
//Load Function Definition
// **************************************
function load_home(){
 if(delay){
  clearInterval(delay);
 }
 var j=Math.floor(Math.random()*pArray_l);
 pload._x=0;
 pload._y=0;
 pload.loadMovie(pArray[j]);
 delay=setInterval(load_home,5000);
}

```
