# XML photogallery. Loading two jpgs on one click?

**URL:** https://forum.kirupa.com/t/xml-photogallery-loading-two-jpgs-on-one-click/163002
**Category:** flash
**Created:** [September 18, 2005, 8:43pm UTC](https://forum.kirupa.com/t/xml-photogallery-loading-two-jpgs-on-one-click/163002 "2005-09-18T20:43:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![calverphoto](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@calverphoto](https://forum.kirupa.com/u/calverphoto)
#### Post date: [September 18, 2005, 8:43pm UTC](https://forum.kirupa.com/t/xml-photogallery-loading-two-jpgs-on-one-click/163002/1 "2005-09-18T20:43:25Z")

</div>

Hi All,

I’ve successfull managed to complete the thumbnail gallery tutorial on [kirupa.com](http://kirupa.com) (which is fantastic). Now I want it so when I click on the thumbnail 2 jpgs load in different locations (i.e into 2 different MC’s). I’ve tried making two movie clips with different instance names and adding all the extra lines in the AS, which I can do with as many text boxes as possible with success (see below)

-This all works okay:

[COLOR=Orange]function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
photographer = [];  
agency = [];  
client = [];  
thumbnails = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
photographer\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
agency\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
client\* = xmlNode.childNodes\*.childNodes[3].firstChild.nodeValue;  
thumbnails\* = xmlNode.childNodes\*.childNodes[4].firstChild.nodeValue;  
thumbnails\_fn(i);

etc…

function nextImage() {  
if (p\<(total-1)) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
photo\_txt.text = photographer[p];  
agency\_txt.text = agency[p];  
client\_txt.text = client[p];  
picture\_num();  
}  
}  
}  
function prevImage() {  
if (p\>0) {  
p–;  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
photo\_txt.text = photographer[p];  
agency\_txt.text = agency[p];  
client\_txt.text = client[p];  
picture\_num();  
}  
}  
function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
photo\_txt.text = photographer[0];  
agency\_txt.text = agency[0];  
client\_txt.text = client[0];  
picture\_num();  
}  
}

etc…  
[/COLOR]

///////////////////////////////////////

Along with my xml:

\<pic\>  
\<image\>swf/puma\_hoody.swf\</image\>  
\<caption\>Richard Foster\</caption\>  
\<caption\>GBH\</caption\>  
\<caption\>Puma\</caption\>  
\<thumbnail\>thumbs/2s.jpg\</thumbnail\>

But don’t seem to be able to add an extra picture in like I can with the text.

Any help or ideas.

Paul.

If the above doesn’t make any sense, then I try and explain further…
