# Photo Gallery problem

**URL:** https://forum.kirupa.com/t/photo-gallery-problem/19509
**Category:** flash
**Created:** [April 28, 2003, 8:20pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509 "2003-04-28T20:20:52Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![arp\_laszlo](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@arp\_laszlo](https://forum.kirupa.com/u/arp_laszlo)
#### Post date: [April 28, 2003, 8:20pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/1 "2003-04-28T20:20:52Z")

</div>

Folks,

First, thanks Kirupa for a great tutorial about the Flash MX Photo Gallery! Now I’m having one problem - the images aren’t being displayed properly. Logically, it seems that Flash is assuming that their registration point is the upper left, as that corner seems to be in the middle of the gallery. How is this fixed? Check out [COLOR=orange][my prototype gallery here](http://www.djrx.com/gallery.htm)[/COLOR]. I’ve also uploaded a copy of the .fla to peruse.

Also, the images are NOT being resized. Only the upper left corner can be seen.

Any help, as always, is appreciated.

best regards,

Arp Laszlo

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 28, 2003, 9:05pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/2 "2003-04-28T21:05:00Z")

</div>

paste this script:

```auto
MovieClip.prototype.centered = function(x, y) {
	this._x = x-this._width/2;
	this._y = y-this._height/2;
};

```

and add this line here:

```auto
MovieClip.prototype.loadMeter = function() {
	var i, l, t;
	l = this.photo.getBytesLoaded();
	t = this.photo.getBytesTotal();
	if (t>0 && t == l) {
		this.onEnterFrame = fadeIn;
		**this.photo.centered(x, y);**
	} else {
		trace(l/t);
	}
};

```

change the parameters x and y to suit your needs. ie.

```auto
// if you want it centered at x:150 y:220
this.photo.centered(150, 220);

```

=)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 28, 2003, 9:31pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/3 "2003-04-28T21:31:35Z")

</div>

Thanks for the tips. Oddly, the first picture is still like that, but the following ones are in the right place but you can only see their lower right corner. I’m gonna play around and get this thing right…

Arp

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 29, 2003, 12:06am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/4 "2003-04-29T00:06:28Z")

</div>

OK - I just moved the movie clip until it looked right. I tried messing with the code you suggested, tried messing with reg point, etc, to no avail.

However, moving the movie clip was really easy, so I can’t complain. Still, thanks for your advice!

Arp

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 29, 2003, 12:10am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/5 "2003-04-29T00:10:23Z")

</div>

:stunned: 😛

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 8, 2003, 4:25pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/6 "2003-05-08T16:25:13Z")

</div>

is it possible to make the script so i resizes the picture to fit in the photo frame?

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 8, 2003, 8:20pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/7 "2003-05-08T20:20:34Z")

</div>

also, how do you make it so when it doesnt find an image, it goes back to the first image, like a loop. Right now when it doesnt find an image it just outputs “0” infinitely.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 9, 2003, 3:57am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/8 "2003-05-09T03:57:59Z")

</div>

I still need an answer. Like, really badly…

Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 9, 2003, 4:54am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/9 "2003-05-09T04:54:09Z")

</div>

Is the outputting of the zero when you’re testing the movie in flash? i found that it didn’t work right when testing, but it worked fine when uploaded to my webpage. I didn’t need any extra code to make the gallery loop.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 9, 2003, 5:00am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/10 "2003-05-09T05:00:21Z")

</div>

ok, thats good to know, and yes, it was when i was testing. Thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 10, 2003, 8:00am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/11 "2003-05-10T08:00:39Z")

</div>

oops… i missed this thread. 😛

anyway, here’s something really easy, no maths required. 😉

```auto
MovieClip.prototype.resize = function(wMax, hMax) {
	while (this._width>wMax || this._height>hMax) {
		this._xscale = this._yscale -= 1;
	}
};
myMovieClip.resize(wMax, hMax);

```

just specify wMax (maximum width) and hMax (maximum height) and the MovieClip will be scaled proportionally. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 10, 2003, 5:04pm UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/12 "2003-05-10T17:04:29Z")

</div>

execelent dude. thanks ALOT! 🙂 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 11, 2003, 1:09am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/13 "2003-05-11T01:09:34Z")

</div>

no problem, grayson. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 13, 2003, 6:26am UTC](https://forum.kirupa.com/t/photo-gallery-problem/19509/14 "2003-05-13T06:26:02Z")

</div>

Hi…this is catnip…

I just got the same problem like Arp, and plus when I applied it to my pictures it didn’t show anything on the screen.

Then I added the code from Kax, but the first image still dosent in the right place (by using the photos along with source file). Moreover, I cannt even see any of my images to be shown in the placeholder(an empty movie clip).

Can you tell what’s wrong with this?

think maybe I should try doing this with javascript…
