
Hi all
I’m working on a image Gallery using xml to provide the images and Nav.
This a shortened version of how the xml looks
<portfolio>
<fashion>
<image source=“images/fashion01″/>
<image source=“images/fashion02″/>
<image source=“images/fashion03″/>
<image source=“images/fashion04″/>
<image source=“images/fashion05″/>
</fashion>
<portrait>
<image source=“images/portrait01″/>
<image source=“images/portrait02″/>
<image source=“images/portrait03″/>
<image source=“images/portrait04″/>
<image source=“images/portrait05″/>
</portrait>
<editorial>
<image source=“images/editorial01″/>
<image source=“images/editorial02″/>
<image source=“images/editorial03″/>
<image source=“images/editorial04″/>
<image source=“images/editorial05″/>
</editorial>
<travel>
<image source=“images/travel01″/>
<image source=“images/travel02″/>
<image source=“images/travel03″/>
<image source=“images/travel04″/>
<image source=“images/travel05″/>
</travel>
</portfolio>
From this xml the gallery will have 4 sections - fashion, portrait, editoral and travel.
I want to pull these sections from the xml and use them as the Navigation (I have buttons in the library with text fields that will be filled with the names of the sections.)
I wanted to then create arrays that contain the references to the images for that section and link them to the buttons - so clicking the fashion button I would have an array that contains the links to the images in the fashion section.
I could do this using AS1 where I would loop through the first tear in the xml giving me fashion, portrait, editorial and travel and then loop again inside that loop to give me the image references to that section.
I’ve been trying to do the same sort of thing with AS3, but I can only get to the whole the xml to trace
var xml:XML; var xmlList:XMLList; var xmlLoader:URLLoader = new URLLoader(); // xmlLoader.load(new URLRequest(“images.xml”)); xmlLoader.addEventListener(Event.COMPLETE, xmlloaded); // function xmlloaded(evt:Event):void { xml=XML(evt.target.data); xmlList=xml.children(); trace(xmlList); }
How can I get to the first tear of the xml to give me fashion, portrait, editorial and travel, while I’m doing this link the image references to these.
Can anyone point me in the right direction - Any help appreicated.
If you would like to make a comment, please fill out the form below.
Recent Comments