# Photogallery/Thumbs in Grid?

**URL:** https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318
**Category:** Uncategorized
**Created:** [April 12, 2006, 1:47pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318 "2006-04-12T13:47:02Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 12, 2006, 1:47pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/1 "2006-04-12T13:47:02Z")

</div>

I am very new to this, so please bare with me. Can anyone help me put the thumbs in a 3 column, 3 row grid?

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 12, 2006, 3:23pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/2 "2006-04-12T15:23:12Z")

</div>

I tried using the file on this thread:

> **[Dynamic Pageing?!](https://www.kirupa.com/forum/showthread.php?t=93543)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

But when I click on one of the thumbs i get this:  
Error opening URL “file:///Macintosh%20HD/Users/MacDaddy/Desktop/CurrentWork/FLASH%26XML%20TUTORIAL/test/undefined”

I know everyone is probably sick of the photogallery stuff, but it’s all very new to me and I’d really appreciate the help.

Thanks

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 13, 2006, 12:35pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/3 "2006-04-13T12:35:45Z")

</div>

can anybody help with this…😟 … please

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 13, 2006, 12:40pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/4 "2006-04-13T12:40:04Z")

</div>

What’s the code your using, or post a .fla…

scotty(-:

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 13, 2006, 1:03pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/5 "2006-04-13T13:03:39Z")

</div>

how do I post so that the code is in a scroll area?

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 13, 2006, 1:08pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/6 "2006-04-13T13:08:38Z")

</div>

I’m using this, its from one of your old posts:

```auto
var thumb_spacing = 76;
var thumb_height = 60;
// number of columns you want
var columns = 3;
// number of rows you want
var rows = 3;
function GeneratePortfolio(portfolio_xml) {
	var portfolioPictures = portfolio_xml.firstChild.childNodes;
	var positionX = 0;
	// var to determine how much pages there will be
	var pages;
	// put everything inside scroll_mc
	var scroll_mc = menu_mc.createEmptyMovieClip("scroll_mc", 99);
	// mask scroll mc
	scroll_mc.setMask(mask);
	for (var i = 0; i<portfolioPictures.length; i++) {
		var currentPicture = portfolioPictures*;
		var currentThumb_mc = scroll_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
		// returns the number of pages
		pages = Math.floor((i/(rows*columns)));
		// position of the different pages
		var pageing = pages*(columns*thumb_spacing);
		// thumb x position
		currentThumb_mc._x = (i%columns)*thumb_spacing+pageing;
		// thumb y position
		currentThumb_mc._y = (Math.floor(i/columns)%rows)*thumb_height;
		currentThumb_mc.createEmptyMovieClip("thumb_container", 0);
		currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
		currentThumb_mc.image = currentPicture.attributes.image;
		currentThumb_mc.imgurl = currentPicture.attributes.imgurl;
		currentThumb_mc.onRelease = function() {
			image_mc.holder.loadMovie(this.image);
			image_mc.theurl = this.imgurl;
			image_mc.onRelease = function() {
				getURL(this.theurl, _blank);
			};
			image_mc.onRollOver = function() {
				this.attachMovie("rollme", "myroll", 1);
			};
			image_mc.onRollOut = function() {
				this.myroll.removeMovieClip();
			};
		};
		currentThumb_mc.onRollOver = function() {
			this.attachMovie("rollit", "newroll", 2);
			this.newroll._alpha = 40;
		};
		currentThumb_mc.onRollOut = function() {
			this.newroll.removeMovieClip();
		};
	}
	// if there are more then 1 page
	if (pages>0) {
		for (var i = 0; i<=pages; i++) {
			// attach a button for each page
			var pag = this.attachMovie("page_btn", "page"+i, 99+i);
			// position of the btton
			pag._x = 25+i*50;
			pag._y = 350;
			// identifier for the button
			pag.id = i;
			// button text
			pag.info.text = i+1;
			pag.onPress = function() {
				// show the right page
				// you could add some easing...
				menu_mc.scroll_mc._x = -(this.id*(columns*thumb_spacing));
			};
		}
	}
}
// xml object for xml content
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
	if (success) {
		GeneratePortfolio(this);
	} else {
		trace("Error loading XML file");
	}
};
// load
portfolio_xml.load("portfolio2.xml");

```

And then I down loaded portfolio2.xml to go along with it:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<menu>
	

				<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
				<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
                <image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
                <image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
                <image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
		
				<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Greetings from Holland"/>
				<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
				<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>

				<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
                <image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
                <image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
                <image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Snow"/>
				<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Cat and Dog"/>
				<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>

				<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>

				<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Cat and Dog"/>
				<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Relief"/>
				<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Greetings from Holland"/>
				<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
				<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Whales"/>
                <image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Bridge"/>
                <image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
	
</menu>

```

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 13, 2006, 2:25pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/7 "2006-04-13T14:25:37Z")

</div>

On first sight, the code seems ok, can you post your files?

scotty(-:

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 13, 2006, 2:39pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/8 "2006-04-13T14:39:06Z")

</div>

Thanks, here is the flash file & XML file.

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 13, 2006, 7:56pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/9 "2006-04-13T19:56:15Z")

</div>

any thoughts???

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 14, 2006, 7:58am UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/10 "2006-04-14T07:58:08Z")

</div>

In the AS look for this line

```auto
currentThumb_mc.image = currentPicture.attributes.image;

```

it refers at the wrong attribute, it should read

```auto
currentThumb_mc.image = currentPicture.attributes.source;

```

scotty(-:

---

<div class="post-metadata">

### Author: ![caynada](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@caynada](https://forum.kirupa.com/u/caynada)
#### Post date: [April 18, 2006, 12:44pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/11 "2006-04-18T12:44:36Z")

</div>

thats wicked, thanks very much scotty!!!

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 18, 2006, 12:58pm UTC](https://forum.kirupa.com/t/photogallery-thumbs-in-grid/185318/12 "2006-04-18T12:58:36Z")

</div>

no problem :thumb:
