# Dynamic photo gallery problem

**URL:** <https://forum.kirupa.com/t/dynamic-photo-gallery-problem/134922>\
**Category:** Uncategorized\
**Created:** [January 22, 2005, 11:06pm UTC](https://forum.kirupa.com/t/dynamic-photo-gallery-problem/134922 "2005-01-22T23:06:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![puck](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@puck](https://forum.kirupa.com/u/puck)\
**Post date:** [January 22, 2005, 11:06pm UTC](https://forum.kirupa.com/t/dynamic-photo-gallery-problem/134922/1 "2005-01-22T23:06:50Z")

</div>

aight…  
so i’ve got this gallery and all’s well…  
what i want is for the previous image to stay visible until the next image is loaded… what i’m doing is loading each image into a progressively higher level than the previous one…

like this:  
on the “next” button:

```auto
on(release){_root.pageturn.gotoAndPlay(2); 
   ++i; 
   ++n; 
   if(i>commercial){ 
   	i=1; 
   	gotoAndPlay("commercial1"); 
   }else{ 
   gotoAndPlay("commercial1"); 
   }} 

```

and then in frame “commercial1”:

```auto
_root.empty2.createEmptyMovieClip("loader"+[n],n); 
   loadMovie("commercial/commercial"+*+".jpg",_root.empty2["loader"+n]);

```

the “i” controls which image is loaded (and “commercial” in i\>commercial is a variable loaded from a text document, so it loops at the end of each set of images) and the “n” controls what level it loads on.  
all works cool, except…

PROBLEM:  
when i hit a button, instead of the previous image just staying there until the next one finishes loading, it flash first… just a little pop of white…  
i’m not sure what’s causing it and it’s very visually disruptive… anyone got any ideas?

thanks,  
puck
