# Problem with image-gallery

**URL:** https://forum.kirupa.com/t/problem-with-image-gallery/179309
**Category:** flash
**Created:** [February 18, 2006, 6:43pm UTC](https://forum.kirupa.com/t/problem-with-image-gallery/179309 "2006-02-18T18:43:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Epatti](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/epatti/32/2166_2.png) [@Epatti](https://forum.kirupa.com/u/Epatti)
#### Post date: [February 18, 2006, 6:43pm UTC](https://forum.kirupa.com/t/problem-with-image-gallery/179309/1 "2006-02-18T18:43:34Z")

</div>

Hi

I’m doing a gallery, and I have managed to load thumbs perfectly. I have a function that should load a bigger version of the picture on placeholder, but theres something wrong with that function(or something), it just loads all the pictures on a pile to placeholder, even if I don’t press any thumbnail. If you know whats wrong, please tell me. You can see the script here:

This script is in frame 1 of thumbMC, the whole build goes like: main -\> textMC -\> picsMC -\> thumbMC

```auto

for (i=1; i<=10; i++) {
this.createEmptyMovieClip("pic"+i,i);
this["pic"+i].loadMovie("thumb/thumb"+i+".jpg");
x_skip = 65;
y_skip = 75;
n_per_row = 8;
this["pic"+i]._x = ((i-1)%n_per_row)*x_skip;
this["pic"+i]._y = int((i-1)/n_per_row)*y_skip;

this["pic"+i].OnPress = this._parent.openPic(i); // Points to openPic() function which is in picsMC, to open the bigger version of the picture.
}

```

This script is in frame 1 of picsMC  
(I have made a placeholderMC into picsMC)

```auto

function openPic(picId) {
placeholder.loadMovie("pics/pic"+picId+".jpg");
}

```

You can see those same codes in here (more clearly) [http://epatti.pastebin.com](http://epatti.pastebin.com) (two most recent posts, top ones)

Thanks 🙂
