# XML & categories

**URL:** <https://forum.kirupa.com/t/xml-categories/244987>\
**Category:** flash\
**Created:** [November 24, 2007, 8:48pm UTC](https://forum.kirupa.com/t/xml-categories/244987 "2007-11-24T20:48:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToubMor](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/toubmor/32/3422_2.png) [@ToubMor](https://forum.kirupa.com/u/ToubMor)\
**Post date:** [November 24, 2007, 8:48pm UTC](https://forum.kirupa.com/t/xml-categories/244987/1 "2007-11-24T20:48:02Z")

</div>

Hi there,

Iv posted this also in actionscript 1&2 but no replies.  
ive been searching the forum for hours but cant exactly find what i need. Im building this navigation/gallery sort a thing and im using KIRUPA’s gallery. I know how this thing works now, but i iwant to try something else. I the navigation ive build in the gallery. On every link i want the gallery to swap to a other category of images. I cant figure it OUT… help please.

here’s my code, so far

Code:  
//var url = “[http://www.cvay.com/new/navigatie/](http://www.cvay.com/new/navigatie/)”;function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; category = []; ctotal= xmlNode.childNodes.length; total = xmlNode.firstChild.childNodes.length; for (i=0; i\<total; i++) { image\* = xmlNode.childNodes[0].childNodes\*.firstChild.firstChild.nodeValue; } for (i=0; i\<ctotal; i++) { category\* = xmlNode.childNodes\*.nodeName; } firstImage(); } else { \_parent.nextFrame(); }}var test = new Array(category\*);trace (test)xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load(“nav\_images.xml”);/////////////////////////////////////c = 0; function nextCategory(){ c++; trace©; loadXML(); trace(image)}function nextImage() { if (p\<(total-1)) { p++; if (loaded == filesize) { main.\_alpha = 0; main.loadMovie(image[p]); } } if (p ==(total-1)){ p = 0-1; }}function firstImage() { p = 0; if (loaded == filesize) { main.\_alpha = 0; main.loadMovie(image[0], 1); }}/////////////////////////////////////////////////// PRELOADERonEnterFrame = function() { filesize = \_root.main.getBytesTotal(); loaded = \_root.main.getBytesLoaded(); var amount:Number = \_root.main.getBytesLoaded() / \_root.main.getBytesTotal() _100; \_root.preloader\_mc.\_visible = true; if (loaded != filesize) { \_root.preloader\_mc.preload\_bar.\_xscale = 100_loaded/filesize; \_root.preloader\_mc.loadProc\_mc.\_x = preloader\_mc.preload\_bar.\_width - preloader\_mc.loadProc\_mc.\_width+20; } else { \_root.preloader\_mc.\_visible = false; if (\_root.main.\_alpha\<100) { \_root.main.alphaTo(100,1,“linear”); } }};  
heres the XML

Code:  
\<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?\>\<images\> \<home\> \<pic\> \<image\>home\_1.jpg\</image\> \</pic\> \<pic\> \<image\>home\_2.jpg\</image\> \</pic\> \<pic\> \<image\>home\_3.jpg\</image\> \</pic\> \<pic\> \<image\>home\_3.jpg\</image\> \</pic\> \</home\> \<villassale\> \<pic\> \<image\>villassale\_1.jpg\</image\> \</pic\> \<pic\> \<image\>villassale\_2.jpg\</image\> \</pic\> \<pic\> \<image\>villassale\_3.jpg\</image\> \</pic\> \</villassale\>\</images\>  
the [link](http://www.mambocuracao.com/v2/tests/cvay.htm) for the banner

if someone could explain it to me

thnx
