# Gallery issues

**URL:** <https://forum.kirupa.com/t/gallery-issues/227519>\
**Category:** flash\
**Created:** [May 30, 2007, 11:47pm UTC](https://forum.kirupa.com/t/gallery-issues/227519 "2007-05-30T23:47:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![htrain26](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@htrain26](https://forum.kirupa.com/u/htrain26)\
**Post date:** [May 30, 2007, 11:47pm UTC](https://forum.kirupa.com/t/gallery-issues/227519/1 "2007-05-30T23:47:34Z")

</div>

Hey there. I’m kind of in a huge deadline crunch.

I have a gallery that I built from a tutorial I found online–it has an empty mc with a border around it, and when you click on a thumbnail an image is loaded into the mc and it fades in when it loads in and out.

Ofcourse it works fine offline, but when I test it online the image will load in off-center, if you click the thumbnail again (after it has loaded the first time) it loads in the position it should be in.

Here is the code I have on the first frame:  
spacing = 1;  
containerMC.\_alpha = 0;

MovieClip.prototype.loadPic = function(pic){  
containerMC.\_alpha = 0;  
this.loadMovie(pic);  
onEnterFrame = function(){  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
if (t != 0 && Math.round(l/t) == 1){  
var w = containerMC.\_width + spacing, h = containerMC.\_height + spacing;  
border.resizeMe(w, h);  
delete this.onEnterFrame;  
}  
}

};  
MovieClip.prototype.resizeMe = function(w, h) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1) {  
this.\_width = w;  
this.\_height = h;  
containerMC.\_x = this.\_x-this.\_width/2+spacing/2;  
containerMC.\_y = this.\_y-this.\_height/2+spacing/2;  
containerMC.\_alpha += 5;  
if (containerMC.\_alpha\>90) {  
containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};

and here is the code that I have on my btns:  
on(release){  
\_parent.containerMC.loadPic(“pic\_001.jpg”);  
}

Any suggestions???  
I really need some quick help on this one.

Thanks so much in advanced!!!

hutch.
