# Help centering different sizes jpg´s - Gallery

**URL:** <https://forum.kirupa.com/t/help-centering-different-sizes-jpg-s-gallery/178965>\
**Category:** flash\
**Created:** [February 15, 2006, 7:31pm UTC](https://forum.kirupa.com/t/help-centering-different-sizes-jpg-s-gallery/178965 "2006-02-15T19:31:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hentschke](https://avatars.discourse-cdn.com/v4/letter/h/b487fb/32.png) [@hentschke](https://forum.kirupa.com/u/hentschke)\
**Post date:** [February 15, 2006, 7:31pm UTC](https://forum.kirupa.com/t/help-centering-different-sizes-jpg-s-gallery/178965/1 "2006-02-15T19:31:26Z")

</div>

[FONT=Arial][SIZE=2]Hi all, im making a gallery that load an image in a movie clip when i click in a button. All seems to work perffectly in “local”. My problem is when i put my gallery on-line. To me it appears not to get the “width” and the “height” untill the image is fully loaded. In the “AS” have some kind of “checker”, but obviously its not working, can someone help this “semi-noob”? :)[/SIZE][/FONT]

here is the link: [[COLOR=#800080]http://www.tendez.com.br/lage/test/flash\_coders\_image\_loader.html[/COLOR]](http://www.tendez.com.br/lage/test/flash_coders_image_loader.html)

Here is what i have in my first and only frame:

```php
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
 _root.containerMC._alpha = 0;
 this.MovieClip(pic);
 _root.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 _root.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;
   _root.containerMC._x = this._x-this._width/2+spacing/2;
   _root.containerMC._y = this._y-this._height/2+spacing/2;
   _root.containerMC._alpha = 100;
   delete this.onEnterFrame;
  }
 };
};

```

And here what i have in the button that call the image

```php
 on (release) {
 containerMC.loadPic("img/01.jpg");
}

```

Help me!! For god sake! 😃
