# \[fmx\] xml & flash

**URL:** <https://forum.kirupa.com/t/fmx-xml-flash/181086>\
**Category:** flash\
**Created:** [March 6, 2006, 11:27am UTC](https://forum.kirupa.com/t/fmx-xml-flash/181086 "2006-03-06T11:27:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliman](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@juliman](https://forum.kirupa.com/u/juliman)\
**Post date:** [March 6, 2006, 11:27am UTC](https://forum.kirupa.com/t/fmx-xml-flash/181086/1 "2006-03-06T11:27:29Z")

</div>

hello  
i would like to do a gallery with dynamic buttons loading dynamic images.  
the problem is i can’t figure out how to link the buttons to the images!  
here is what i have:

```auto
var rubriques = pxml.firstChild.childNodes;
var nbrubriques = rubriques.length;
var edo = pxml.firstChild.firstChild;
var web = pxml.firstChild.childNodes[1];
var sce = pxml.firstChild.childNodes[2];
var pho = pxml.firstChild.childNodes[3];
var nbEdo = edo.childNodes.length;
var nbWeb = web.childNodes.length;
var nbSce = sce.childNodes.length;
var nbPho = pho.childNodes.length;
/////////////////////interface/////////////////////////
this.createEmptyMovieClip("bt", 10);
this.createEmptyMovieClip("image", 9);
//
//images
for (var p = 0; p<nbEdo; p++) {
	var projet = edo.childNodes[p];
	var nbProjet = projet.childNodes.length;
	var images = projet.firstChild.childNodes;
	bt.createEmptyMovieClip(["titre"+p], p);
	bt["titre"+p]._x = 0;
	bt["titre"+p]._y = 15*p;
	bt["titre"+p].createTextField("titre", 1650, 20, 20, 200, 40);
	var titre = projet.attributes.titre;
	bt["titre"+p].titre.text = titre;
	bt["titre"+p].titre.setTextFormat(new TextFormat("uni 05_54", 8, 0xffffff));
	bt["titre"+p].titre.embedFonts = true;
	//
	bt["titre"+p].createemptymovieclip("fond", -800);
	bt["titre"+p].fond.rectangle();
	bt["titre"+p].onEnterFrame = function() {
		this.onRollOver = function() {
			this.fond.survol();
		};
		this.onRollOut = function() {
			this.fond.rectangle();
		};
		this.onRelease = function() {
			this.fond.clic();
			for (var s = 0; s<images.length; s++) {
				var img = images[s];
				imgName = img.attributes.name;
				image.createEmptyMovieClip(["image"+s], -100+s);
				image["image"+s]._y = 250*s;
				image["image"+s]._x = 0;
				image["image"+s].loadMovie(imgName);
			}
		};
		if (0 == 0) {
			trace("ok");
			delete this.onEnterFrame;
		}
	};
}

```

the xml would be something like this :

```auto

<?xml version='1.0' encoding='UTF-8' ?> 
<racine> 
    <edo> 
        <projet titre= "xxx"> 
            <images> 
                <img name="images/xxx/01.jpg"/> 
                <img name ="images/xxx/02.jpg"/> 
                <img name ="images/xxx/03.jpg"/> 
                <img name ="images/xxx/04.jpg"/> 
                <img name ="images/xxx/05.jpg"/> 
            </images> 
        </projet> 
    </edo> 
</racine>

```

where edo length changes (according to number of projects) and images length changes (according to number of img)

i read the introduction to xml tut on this site, that what helped me to get so far, but now i am stuck and don’t see how to go further!! please help!!!:hangover:
