Problems reading XMLList data

Hi everyone,
First I’d like to say how great everyone in this forum is, and I have been refereing to it for many years. This is my very first question… I’ve always found my answers here without asking, but this time I am really really stuck:cry3:

What I am trying to do is basically reteive information from an XMLList. Sounds simple enough… and I’m sure it is. I have read every bit of info I can find on this topic including your tutorials here and even the ones on senocular’s site… as well as the book Essential ActionScript 3.0.

Ok. Basically I am creating a slideshow where the thumbnails are generated from the image names in the XML file… the loaded thumbs have been given an instance name corresponding to the image name. This works fine. When the user clicks on the thumbnail, the corresponding image appears in the larger display, for example the first thumbnail has an instance name of image01, so when it is clicked the code reads this instance name and image01.jpg will load. :thumb: Too easy! Works a treat.

Now to the problem.
The XML file also has a description attribute in it. So when The user has decided to load image01 - I want to use this information to go back and pull the relevant description from the XML file… which I have put into an XMLList. I cannot pull this info out. I have successfully traced the entire list, therfore I know there is data in there, but I can’t pull out the bits I want.

Here is the part of my code that is relevant to my problem. I’m sure I am missing something really basic here, but I just can’t see anymore… perhaps I’ve had too much coffee:insomniac:

//Snippet of XML file that is already loaded (xmlLoader.data)
<slideshow>
<image src=“image01.jpg” desc=“blah”/>
<image src=“image02.jpg” desc=“scenery”/>
<image src=“image03.jpg” desc=""/>
<image src=“image04.jpg” desc=“the back fence”/>
<image src=“image05.jpg” desc=“another title”/>
</slideshow>

var myXMLlist:XMLList;
var dataXml:XML=XML(xmlLoader.data);
//myXMLlist=dataXml.children(); <- should I use this or …next line? Have tried both and //same result
myXMLlist=dataXml.image;

function loadMainImage(e:MouseEvent):void {
// Here we retrieve the instance name of the thumbnail that was clicked -works fine
imageURL=e.target.name + “.jpg”;
var myImage:String=urlPath + imageURL;

// THIS IS WHERE MY PROBLEMS ARE /////////////////////////////////////////////////
trace(myXMLlist.image.(attribute("src") == imageURL)); // nothing
trace(myXMLlist.image.(attribute("src") == "image02.jpg" )); //nothing
trace(myXMLlist); //traces full list
var thisTitle:XMLList=myXMLlist.image.(attribute("src") == imageURL); 
trace("New Description=" + thisTitle); //Still nothing
//////////////////////////////////////////////////////////////////////////////////
//load the image
createLoader();
loader.load(new URLRequest(myImage));

}

All of the trace options above give me nothing except for trace(myXMLlist); which gives me this -
<image src=“image01.jpg” desc=“blah”/>
<image src=“image02.jpg” desc=“scenery”/>
<image src=“image03.jpg” desc=""/>
<image src=“image04.jpg” desc=“the back fence”/>
<image src=“image05.jpg” desc=“another title”/>

I have tried so many different combinations I have lost my mind… please can anyone see what I am missing?
Your help is always appreciated.
Thank you