# \[F8 AS2\] photo gallery using varying xml's

**URL:** https://forum.kirupa.com/t/f8-as2-photo-gallery-using-varying-xmls/244312
**Category:** flash
**Created:** [November 16, 2007, 6:56am UTC](https://forum.kirupa.com/t/f8-as2-photo-gallery-using-varying-xmls/244312 "2007-11-16T06:56:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mr\_pink1](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mr\_pink1](https://forum.kirupa.com/u/mr_pink1)
#### Post date: [November 16, 2007, 6:56am UTC](https://forum.kirupa.com/t/f8-as2-photo-gallery-using-varying-xmls/244312/1 "2007-11-16T06:56:36Z")

</div>

please excuse me, i know similar topics have already been resolved, but i can’t figure this out for the life of me. i have my photo gallery (thanks to the kirupa tut!) and can get it to load a single gallerycontent.xml file. what i want to do is use my single flash photo gallery to display photos from multiple xml’s.

i’m thinking that i need to use some sort of FlashVars attribute in the embed tag of the published html, but i can’t figure out how to tell my flash file to look for it…

here’s my AS (i think the problem lies in this chunk):

[COLOR=gray]function loadXML(loaded) { [/COLOR]  
[COLOR=gray]if (loaded) { [/COLOR]  
[COLOR=gray]xmlNode = this.firstChild; [/COLOR]  
[COLOR=gray]image = []; [/COLOR]  
[COLOR=gray]description = []; [/COLOR]  
[COLOR=gray]total = xmlNode.childNodes.length; [/COLOR]  
[COLOR=gray]for (i=0; i\<total; i++) { [/COLOR]  
[COLOR=gray]image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue; [/COLOR]  
[COLOR=gray]description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue; [/COLOR]  
[COLOR=gray]} [/COLOR]  
[COLOR=gray]firstImage(); [/COLOR]  
[COLOR=gray]} else { [/COLOR]  
[COLOR=gray]content = “file not loaded!”; [/COLOR]  
[COLOR=gray]} [/COLOR]  
[COLOR=gray]} [/COLOR]  
[COLOR=gray]xmlData = new XML(); [/COLOR]  
[COLOR=gray]xmlData.ignoreWhite = true; [/COLOR]  
[COLOR=gray]xmlData.onLoad = loadXML; [/COLOR]  
[COLOR=gray]xmlData.load("[COLOR=red]HCAGG3[/COLOR]/gallerycontent.xml");  
////////////////////////////////[/COLOR]  
of course, i want to dynamically change the [COLOR=red]HCAGG3[/COLOR] directory so it can be defined via the HTML page the flash file is on.

thanks in advance!!!
