# Fade image in simple gallery

**URL:** <https://forum.kirupa.com/t/fade-image-in-simple-gallery/294757>\
**Category:** Uncategorized\
**Created:** [August 19, 2009, 1:17pm UTC](https://forum.kirupa.com/t/fade-image-in-simple-gallery/294757 "2009-08-19T13:17:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elefen](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@elefen](https://forum.kirupa.com/u/elefen)\
**Post date:** [August 19, 2009, 1:17pm UTC](https://forum.kirupa.com/t/fade-image-in-simple-gallery/294757/1 "2009-08-19T13:17:45Z")

</div>

Hello,

i am trying to fit gallery to my needs and actually i stop on problem with fading in and fading out. What i wanna do is fade in new picure on last visible picture - so last picture is still visble in backgroun when new one is fading in on same place and so on. Any idea how to change the code i will be grateful.

here is code that load the images (i also attached fla file cs3):

```auto

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;
      }
   }
};
var myInterval;
function nextImage() {
   p++;
   p %= image.length;
   if (loaded == filesize) {
      picture._alpha = 0;
      picture.loadMovie(image[p], 100);
      caption.desc_txt.text = description[p];
      picture_num();
      clearInterval(myInterval);
      if (playing) {
         slideshow();
      }
   }
}
function prevImage() {
   clearInterval(myInterval);
   if (playing) {
      slideshow();
   }
   if (p>0) {
      p--;
   } else {
      p = image.length-1;
   }
   picture._alpha = 0;
   picture.loadMovie(image[p], 1);
   caption.desc_txt.text = description[p];
   picture_num();
}

function firstImage() {
   if (loaded == filesize) {
      picture._alpha = 0;
      picture.loadMovie(image[0], 100);
      caption.desc_txt.text = description[0];
      caption.desc_txt._visible = false;
      picture_num();
      clearInterval(myInterval);
      if (playing) {
         slideshow();
         
      }
   }
}

```
