# Multiple Photo galleries?

**URL:** https://forum.kirupa.com/t/multiple-photo-galleries/20018
**Category:** flash
**Created:** [May 4, 2003, 2:48am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018 "2003-05-04T02:48:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![soulty](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/soulty/32/105_2.png) [@soulty](https://forum.kirupa.com/u/soulty)
#### Post date: [May 4, 2003, 2:48am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/1 "2003-05-04T02:48:07Z")

</div>

Hey all, been Working on my new website, and trying to get a dynamic Photo gallery working, I got it working fine for one section, But say i had 4 other section with different images in each section, How would i go around to do this, setting up a array for each section? Any help will be great.

---

<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 4, 2003, 6:26am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/2 "2003-05-04T06:26:09Z")

</div>

bump;)

---

<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 4, 2003, 7:13am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/3 "2003-05-04T07:13:23Z")

</div>

well, it really depends on how you set up the gallery…  
but i guess you could use a multidimensional array. =)

---

<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 4, 2003, 7:17am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/4 "2003-05-04T07:17:15Z")

</div>

just a simple gallery, basically it’s for the portfolio section. you click what type of work (print, 3d, web) then from that you select a product. now that is where i 'm placing the gallery. If there are 4 products to choose from, each with 4 or more images  
So what do you think i should do?

---

<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 4, 2003, 7:44am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/5 "2003-05-04T07:44:07Z")

</div>

yup… i’d use a multidimensional array.

```auto
gallery = [["1.jpg", "2.jpg"], ["1.jpg", "2.jpg"], ["1.jpg", "2.jpg"], ["1.jpg", "2.jpg"]];

```

you’ll need to define a variable when the product is selected. let’s say the first product is selected, you’d have something like this:

```auto
product1.onRelease = function() {
_global.subgallery = 0;
};

```

then load each jpg with:

```auto
someMovieClip.loadMovie(gallery[subgallery][pic]);

```

pic would be another variable to select the actual image to load. =)

---

<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 4, 2003, 7:48am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/6 "2003-05-04T07:48:27Z")

</div>

kool, i’ll give it a go,thanx mate 🙂

---

<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 4, 2003, 7:50am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/7 "2003-05-04T07:50:22Z")

</div>

ok. =)

let me know if you have any problems. 😉

---

<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 4, 2003, 8:00am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/8 "2003-05-04T08:00:16Z")

</div>

havent got flash in front of me at the moment, but from the code how does it detect which array is to be used?

---

<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 4, 2003, 8:06am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/9 "2003-05-04T08:06:41Z")

</div>

with the variable subgallery…

if the first product is selected: \_global.subgallery = 0;  
if the second product is selected: \_global.subgallery = 1;  
if the third product is selected: \_global.subgallery = 2;  
if the fourth product is selected: \_global.subgallery = 3;

got it? 🙂

---

<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 4, 2003, 8:07am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/10 "2003-05-04T08:07:50Z")

</div>

lol, i just realised that while you posted, kool, be home later tonight to try the code.

---

<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 4, 2003, 8:34am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/11 "2003-05-04T08:34:40Z")

</div>

kax , would you be able to make a quick fla, dont worry about the images. I’m kinda lost here, would be greatly appreciated. 🙂

---

<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 4, 2003, 9:13am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/12 "2003-05-04T09:13:39Z")

</div>

ok… hope this get you started. =)

you’d only need to replace that stupid setText function with a loadMovie action… 😉

**ps.** don’t expect anything fancy… it’s 4:30 am. 😛

---

<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 4, 2003, 9:14am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/13 "2003-05-04T09:14:42Z")

</div>

lol, thanks dude 🙂

I’ll bug you another day, get some rest 🙂

---

<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 4, 2003, 9:19am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/14 "2003-05-04T09:19:32Z")

</div>

get some rest… ?

yeah… i will (… eventually). 😛 😉

---

<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 5, 2003, 8:36am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/15 "2003-05-05T08:36:52Z")

</div>

hey , got your txt verison workin, going to try the jpg soon, though a little problem. Due to my layout, my menu for selecting the products are in its own movie clip.

\_root.menu.scrolly.buttons

Now i have found that even if i have made a path to the button in the actionscript

```auto

_root.menu.scrolly.buttons.subgallery2.onRelease = function() {
	_global.subgallery = 1;
	_global.index = 0;
	setText();

```

It dosent work, i made a dummy button on the main timeline and that button worked. Are there issues with nested Movieclips(movieclips as buttons) or might my paths be wrong? ive checked them again and again, i see no errors?

---

<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 5, 2003, 8:48am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/16 "2003-05-05T08:48:48Z")

</div>

yeah… it could be the addressing. :-\

try targetting the MovieClip containing the TextField.

```auto
_root.menu.scrolly.buttons.subgallery2.onRelease = function() {
_global.subgallery = 1;
_global.index = 0;
_root.someMovieClip.setText();
};
// or if the TextField is in the _root
_root.menu.scrolly.buttons.subgallery2.onRelease = function() {
_global.subgallery = 1;
_global.index = 0;
_root.setText();
};

```

---

<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 5, 2003, 9:18am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/17 "2003-05-05T09:18:05Z")

</div>

hmmm, still not working, ill keep trying at it.

::btw i added your buttons (in your example) in about 3 nested Mc’s and it worked fine, so there might be something wrong with my addressing or layout.

I’ll keep you posted. 🙂  
thanks again

---

<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 5, 2003, 9:21am UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/18 "2003-05-05T09:21:37Z")

</div>

ok… good luck, soulty. 😉

---

<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 6, 2003, 5:16pm UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/19 "2003-05-06T17:16:47Z")

</div>

Hey kax more problems. ☹

First i will say that the code is on the main timeline of a external movie allocated at frame 62 where there is a stop action on top of it.

The Swf is a external movie that is getting loaded into a target mc called content.

I just need to run this by you tto see if this code i’m using is right so i can narrow down what the problem could be.

```auto

_global.setText = function() {
    currentImage.text = gallery[subgallery][index];
};
_global.subgallery=0, _global.index=0;
gallery = [["subgallery1 - pic1", "subgallery1 - pic2"], ["subgallery2 - pic1", "subgallery2 - pic2", "subgallery2 - pic3", "subgallery2 - pic4"]];
_root.content.test.sub1.onRelease = function() {
    _global.subgallery = 0;
    _global.index = 0;
    this.setText();
};
_root.content.test.sub2.onRelease = function() {
    _global.subgallery = 1;
    _global.index = 0;
    this.setText();
};
_root.content.test.sub3.onRelease = function() {
    _global.subgallery = 2;
    _global.index = 0;
    this.setText();
};
_root.content.test.sub4.onRelease = function() {
    _global.subgallery = 3;
    _global.index = 0;
    this.setText();
};
prevPic.onRelease = function() {
    _global.index>0 ? _global.index-- : _global.index=gallery[subgallery].length-1;
    this.setText();
};
nextPic.onRelease = function() {
    _global.index<gallery[subgallery].length-1 ? _global.index++ : _global.index=0;
    this.setText();
};

```

::: btw made the array shorter because it was making the thread really wide in width.

Can u see anything wrong?  
talk soon.  
Soulty 😏  
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 6, 2003, 9:12pm UTC](https://forum.kirupa.com/t/multiple-photo-galleries/20018/20 "2003-05-06T21:12:40Z")

</div>

```auto
_root.content.test.sub1.onRelease = function() {
_global.subgallery = 0;
_global.index = 0;
**this.setText();**
};

```

there must be the problem. try removing **this**. 🙂

[Next page](https://forum.kirupa.com/t/multiple-photo-galleries/20018.md?page=2)
