# Problem with image gallery

**URL:** https://forum.kirupa.com/t/problem-with-image-gallery/211517
**Category:** Uncategorized
**Created:** [January 2, 2007, 4:29pm UTC](https://forum.kirupa.com/t/problem-with-image-gallery/211517 "2007-01-02T16:29:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hema77](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@hema77](https://forum.kirupa.com/u/hema77)
#### Post date: [January 2, 2007, 4:29pm UTC](https://forum.kirupa.com/t/problem-with-image-gallery/211517/1 "2007-01-02T16:29:41Z")

</div>

hi! I got to make changes to a photo gallery but I don’t know how it has been done. There is a column of buttons, all the same and there is this following code. Could anybody please tell me where I could find a tutorial which explains this code???

stop();  
var ruta = “imag/galeria”;  
var total\_fotos = 21;  
var referencia = this;  
var loop:MovieClip = referencia.createEmptyMovieClip(“loop”, referencia.getNextHighestDepth());  
function cargar(imagen) {  
contenedor.loadMovie(imagen);  
loop.onEnterFrame = function() {  
barra.\_visible = 1;  
tot = contenedor.getBytesTotal();  
car = contenedor.getBytesLoaded();  
por = Math.round((car\*100/tot));  
textoPrecarga.text = “Cargando… “+por+”%”;  
barra.\_xscale = por;  
if (tot == car && car\>0) {  
barra.\_visible = 0;  
textoPrecarga.text = “”;  
delete referencia.onEnterFrame;  
}  
};  
}

for (i=1;i\<total\_fotos+1;i++) {  
referencia[“b”+i].foto = ruta+"/"+i+".jpg";  
referencia[“b”+i].onRelease = function(){  
cargar(this.foto);  
clipsobre.\_y = this.\_y;  
}  
}  
cargar(ruta+"/1.jpg");
