# FMX - Interactive Gallery Problems

**URL:** https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377
**Category:** flash
**Created:** [July 22, 2003, 3:14pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377 "2003-07-22T15:14:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![StreetracerX](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@StreetracerX](https://forum.kirupa.com/u/StreetracerX)
#### Post date: [July 22, 2003, 3:14pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/1 "2003-07-22T15:14:36Z")

</div>

Basically I’m trying to build an image gallery that will display 9 thumbnails & clicking on a thumbnail has to load a larger version of that image & some text into a display holding area. I have gotten it so it appears as a slideshow (which is useless to me but gave me a good starting point to test the XML infeed - which works on that baisis) & am trying to build the individual thumbnail click functions & having no luck whatsoever. I’ve also been trying to pre-populate the thumbnails from the XML feed using a variable called imagePaths but I can’t even get them to preload - all I get are greyed thumbholders that when I click on them clear the display areas from the slideshow function. I have a fried head at this stage & am looking for any advice or tips that can help point me in the right direction. This is what I built so far…

slides\_xml = new XML();  
slides\_xml.onLoad = startSlideShow;  
slides\_xml.load(“pictures.xml”);  
slides\_xml.ignoreWhite = true;

function startSlideShow(success) {  
if (success == true) {  
rootNode = slides\_xml.firstChild;  
totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1;  
updateSlide(firstSlideNode);

}  
}  
//  
function updateSlide(newSlideNode) { imagePaths = newSlideNode.attributes.jpegURLs;  
imagePathl = newSlideNode.attributes.jpegURLl;  
slideText = newSlideNode.firstChild.nodeValue;  
loadMovie(imagePathl, targetClip); loadMovie(imagePaths, thumbClip);  
}  
//  
next\_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling;  
if (nextSlideNode == null) {  
break;  
} else {  
currentIndex++;  
element ‘currentIndex’  
updateSlide(nextSlideNode);  
currentSlideNode = nextSlideNode;  
}  
};  
//  
back\_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling;  
if (previousSlideNode == null) {  
break;  
} else {  
currentIndex–;  
currentSlideNode = previousSlideNode;  
updateSlide(previousSlideNode);  
}  
};  
//

// Event handler for ‘Thumbnail Selector slide’ button  
story\_btn1.onRelease = function(){  
imagePathl = newSlideNode[0].attributes.jpegURLl; //index into slideNode array to [0] to set array access point  
slideText = newSlideNode[0].attributes.nodeValue; //takes text from image tag in xml sheet defintion into container ‘slideText’ from array element [0]  
slideText = eval (newSlideNode[0].attributes.nodeValue);  
loadMovie(imagePathl, targetClip); //loads large picture from array access point above into container ‘targetClip’  
}  
//

I’ve used some basics from a Macromedia Slideshow tutorial for this & basically have been using Flash for 4 days now & have used Director before with some intermediate lingo which has given me some idea as to what is going on - but I could really do with another pair of eyes or someone else grey matter who understands this better to even give me a hint or point me in the right direction on something to read to help me here

In advance - I am much obliged to anyone who reads this or takes the time to give me any assistance or advice… I’m fairly new to action scripting & Colin Moock’s book has been a great help thus far - but I can’t seem to get my head around this?? Any ideas?? Anyone???

---

<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: [July 22, 2003, 6:22pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/2 "2003-07-22T18:22:03Z")

</div>

You could try this link: there’s an XML driven portfolio example on there that may help. Thank senocular for the link, it’s from his website…

[http://www.umbc.edu/interactive/fla/](http://www.umbc.edu/interactive/fla/)

---

<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: [July 23, 2003, 11:36am UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/3 "2003-07-23T11:36:01Z")

</div>

thank you sooooooo much for that one - any ideas how you remove the usage of the txt files & instead use an XML node element instead of referring to the text files???

also - How can I contact Senocular??

Thanks

- Ian

---

<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: [July 23, 2003, 11:45am UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/4 "2003-07-23T11:45:03Z")

</div>

Try sending Senocular a Private Message.

---

<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: [July 23, 2003, 12:33pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/5 "2003-07-23T12:33:12Z")

</div>

thank you guys sooooo much - you guys are WAAAAYYYY nice & helpful… will be sure to post a thankyou & links on my site when I’m done…

Thanks again guys…

- Ian  
aka ‘StreetRacerX’

---

<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: [July 23, 2003, 3:14pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/6 "2003-07-23T15:14:26Z")

</div>

I’ve just TWO questions really in relation to senocular’s interactive xml drive portfolio if ANYONE can answer them for me;

(1) IF I am using NINE thumbnails, how do I get it to display the thumbnails in a NEAT 3x3x3 display

&

(2) Instead of using the txt files with the displayText= tags, is there a way I can include what the txt files do inside the XML nodes instead to make it neater & easier for updating instead of updating like 9 files???

Any answers or help with this will see me sorted…

Ian  
aka ‘StreetRacerX’

---

<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: [July 24, 2003, 1:53pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/7 "2003-07-24T13:53:56Z")

</div>

any suggestions??? [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: [July 25, 2003, 10:45am UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/8 "2003-07-25T10:45:14Z")

</div>

I’ve tried breaking the for loop into three to place 3 thumbnails (out of the 9 I wanna use) onto three lines - but the thumbnaisl end up staggered on each line - any ideas how to get them to display as a perfect 3x3 grid???

here’s the for loops I redid:

```
lineOne = 3;

for (child = 0; child &lt; lineOne; child++){
	currentPicture = portfolioTag.childNodes[child];
	currentThumb = menu_mc1.createEmptyMovieClip("thumbnail"+child,child);
	currentThumb._x = child * 38;
	// create image clip in currentThumb:
	image = currentThumb.createEmptyMovieClip("thumbnail_image",0);
	image.loadMovie(currentPicture.attributes.THUMB);
	currentThumb.NAME = currentPicture.attributes.NAME;
	currentThumb.IMAGE = currentPicture.attributes.IMAGE;
	currentThumb.TEXT = currentPicture.attributes.TEXT;
	currentThumb.onRollOver = currentThumb.onDragOver = function(){
		showName_txt.text = this.NAME;
	}

	currentThumb.onRollOut = currentThumb.onDragOut = function(){
		// set the text to an empty string (clearing it)
		showName_txt.text = "";
	}

	currentThumb.onPress = currentThumb.onDragOver = function(){

		image_mc.loadMovie(this.IMAGE);

		info_txt.text = "Loading...";
		timeline.loadVariables(this.TEXT);
	}
}

lineTwo = 6;

for (child = 3; child &lt; lineTwo; child++){
	currentPicture = portfolioTag.childNodes[child];
	currentThumb = menu_mc2.createEmptyMovieClip("thumbnail"+child,child);
	currentThumb._x = child * 38;
	// create image clip in currentThumb:
	image = currentThumb.createEmptyMovieClip("thumbnail_image",0);
	image.loadMovie(currentPicture.attributes.THUMB);
	currentThumb.NAME = currentPicture.attributes.NAME;
	currentThumb.IMAGE = currentPicture.attributes.IMAGE;
	currentThumb.TEXT = currentPicture.attributes.TEXT;
	currentThumb.onRollOver = currentThumb.onDragOver = function(){
		showName_txt.text = this.NAME;
	}

	currentThumb.onRollOut = currentThumb.onDragOut = function(){
		// set the text to an empty string (clearing it)
		showName_txt.text = "";
	}

	currentThumb.onPress = currentThumb.onDragOver = function(){

		image_mc.loadMovie(this.IMAGE);

		info_txt.text = "Loading...";
		timeline.loadVariables(this.TEXT);
	}
}

lineThree = 9;

for (child = 6; child &lt; lineThree; child++){
	currentPicture = portfolioTag.childNodes[child];
	currentThumb = menu_mc3.createEmptyMovieClip("thumbnail"+child,child);
	currentThumb._x = child * 38;
	// create image clip in currentThumb:
	image = currentThumb.createEmptyMovieClip("thumbnail_image",0);
	image.loadMovie(currentPicture.attributes.THUMB);
	currentThumb.NAME = currentPicture.attributes.NAME;
	currentThumb.IMAGE = currentPicture.attributes.IMAGE;
	currentThumb.TEXT = currentPicture.attributes.TEXT;
	currentThumb.onRollOver = currentThumb.onDragOver = function(){
		showName_txt.text = this.NAME;
	}

	currentThumb.onRollOut = currentThumb.onDragOut = function(){
		// set the text to an empty string (clearing it)
		showName_txt.text = "";
	}

	currentThumb.onPress = currentThumb.onDragOver = function(){

		image_mc.loadMovie(this.IMAGE);

		info_txt.text = "Loading...";
		timeline.loadVariables(this.TEXT);
	}
}

```

ANYONE have ANY ideas???

also - if ANYONE has ANY ideas about how to take the displayText variable OUT of the txt files & instead use it within the XML sheet instead I’d be REALLY REALLY greatful!!!

Thanks

– StreetRacerX –

---

<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: [July 25, 2003, 2:05pm UTC](https://forum.kirupa.com/t/fmx-interactive-gallery-problems/26377/9 "2003-07-25T14:05:11Z")

</div>

ok - managed to cop on WHAT I was doing wrong here in relation to the arrangement of the images within the menu\_mc_x_ containers on the seond & third thumbnail presentation lines - forgot to add in a reset valuable for the x position on each line - which I resolved like so, using the 3rd line’s code as an example - the bolded items are the nw additions to correct the positioning problem:

lineThree = 9;  
**thumb\_xpos\_init = 0;**

for (child = 6; child \< lineThree; child++){  
currentPicture = portfolioTag.childNodes[child];  
currentThumb = menu\_mc3.createEmptyMovieClip(“thumbnail”+child,child);  
currentThumb.\_x = **thumb\_xpos\_init** \* 38;  
**thumb\_xpos\_init++;**  
// create image clip in currentThumb:  
image = currentThumb.createEmptyMovieClip(“thumbnail\_image”,0);  
image.loadMovie(currentPicture.attributes.THUMB);  
currentThumb.NAME = currentPicture.attributes.NAME;  
currentThumb.IMAGE = currentPicture.attributes.IMAGE;  
currentThumb.TEXT = currentPicture.attributes.TEXT;  
currentThumb.onRollOver = currentThumb.onDragOver = function(){  
showName\_txt.text = this.NAME;  
}

currentThumb.onRollOut = currentThumb.onDragOut = function(){  
// set the text to an empty string (clearing it)  
showName\_txt.text = “”;  
}

works like a DREAM now in terms of displaying the thumbnails…only problem I have left is the one relating to moving the contents of the displayText variable within the .txt files into the XML sheet - senocular - anyone??? even a hint in the right direction would do at this stage
