# Grid for gallery

**URL:** https://forum.kirupa.com/t/grid-for-gallery/179525
**Category:** flash
**Created:** [February 20, 2006, 11:54pm UTC](https://forum.kirupa.com/t/grid-for-gallery/179525 "2006-02-20T23:54:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sarahdc](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sarahdc](https://forum.kirupa.com/u/sarahdc)
#### Post date: [February 20, 2006, 11:54pm UTC](https://forum.kirupa.com/t/grid-for-gallery/179525/1 "2006-02-20T23:54:50Z")

</div>

Hi:

Awhile back, stringy was nice enough to help me out with the grid for an xml gallery I was working on. His solution (found here [http://www.kirupa.com/forum/showthread.php?t=199835&highlight=grid](http://www.kirupa.com/forum/showthread.php?t=199835&highlight=grid)) worked when I used it before. Well now, I’m using the gallery again and am using nearly the same layout and it won’t work! The loader shows up fine but the thumbnails are not showing up at all. I’m feeling VERY frustrated. Would someone please look at this code and see if they see any errors or if they have a solution to my problem. Also, I would like to add something that forces the first image to appear when the gallery loads. How would I do that? Here’s my code:

myPhoto = new XML();  
myPhoto.ignoreWhite = true;  
myPhoto.onLoad = function(success) {  
// portfolioTag = this.firstChild;  
gridx = 25;  
gridy = 25;  
num = 0;  
for (i=0; i\<5; i++) {  
for (j=0; j\<3; j++) {  
picHolder = this.firstChild.childNodes[i+(j\*3)];  
thumbHolder = thumbnails.createEmptyMovieClip(“thumbnail”+num, num);  
thumbHolder.\_x = gridx_i;  
thumbHolder.\_y = gridy_j;  
num++;  
thumbLoader = thumbholder.createEmptyMovieClip(“thumbnail\_image”, 0);  
thumbLoader.loadMovie(picHolder.attributes.thmb);  
thumbHolder.title = picHolder.attributes.title;  
thumbHolder.main = picHolder.attributes.main;  
thumbHolder.onRelease = function() {  
loader.loadMovie(this.main);  
title\_txt.text = this.title;  
};  
}  
}  
};  
myPhoto.load(“xmlphoto.xml”);

Thanks in advance,  
Sarah
