could anyone please help me. My problem is that I am using a variable to identify an element section of the many galleries I have under the tag "galleryType" and nothing is returning for me to display. Am I searching for my galleryType the right way in my code or do I need to loop through my galleryTypes on my XML. thanks in advance.
here is my xml code:
<My_gallery>
<galleryType Name="GalleryName001">
<images>
<image label="example text" thumb_src="folder/thumb001.jpg">folder/image001.jpg</image>
<image label="example text" thumb_src="folder/thumb002.jpg">folder/image002.jpg</image>
<image label="example text" thumb_src="folder/thumb003.jpg">folder/image003.jpg</image>
</images>
</galleryType>
<galleryType Name="GalleryName002">
<images>
<image label="example text" thumb_src="folder/thumb001.jpg">folder/image001.jpg</image>
<image label="example text" thumb_src="folder/thumb002.jpg">folder/image002.jpg</image>
<image label="example text" thumb_src="folder/thumb003.jpg">folder/image003.jpg</image>
</images>
</galleryType>
</My_gallery>
Here is my as3 code:
public function selectGallery(val:String):void {
galleryName = val;
navClass = new navigationClass(galleryName);
galleryName = navClass.getGalleryType;
loadXML("myGallery001.xml");
}
private function loadXML(img_source:String):void {
xmlData = new XML();
xmlData.ignoreWhitespace = true;
xmlLoader = new URLLoader();
xmlLoader.load(new URLRequest(img_source));
xmlLoader.addEventListener(Event.COMPLETE, XMLloaded);
}
private function XMLloaded(evt:Event):void {
xmlData = new XML(evt.target.data);
// I am getting a result back with my trace but nothing is going into my imgList
imgList = xmlData.galleryType.(@Name==galleryName).images.*;
trace(xmlData.galleryType.(@Name == galleryName).images.*);
}images
imgListdata type, where is it declared and is it created/initialized?