# Help with grabbing an XML value

**URL:** <https://forum.kirupa.com/t/help-with-grabbing-an-xml-value/323717>\
**Category:** flash\
**Created:** [July 13, 2011, 8:14pm UTC](https://forum.kirupa.com/t/help-with-grabbing-an-xml-value/323717 "2011-07-13T20:14:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darth\_Nihilus](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@Darth\_Nihilus](https://forum.kirupa.com/u/Darth_Nihilus)\
**Post date:** [July 13, 2011, 8:14pm UTC](https://forum.kirupa.com/t/help-with-grabbing-an-xml-value/323717/1 "2011-07-13T20:14:57Z")

</div>

Hey guys,

I am tasked with trying to do a slideshow of sorts, and I need to pull the filename of the slide from an xml file and display it, as well as display the appropriate slide notes in a text box.

the xml file they gave me is formatted as below, and with my current code (also below) I’m able to (trace) list all the file names, but I am missing how to address the filename on just one slide – say, slide 1, so I can then load it into a loader.

Any idea what I’m missing to get the attributes out of this based on the slide id number or whatever?  
any help would be appreciated, thanks!

=======

# here’s my code

```auto
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;

var imagesXML:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(new URLRequest("assets/xml/slides_show.xml"));
							  
function xmlLoaded(evt:Event):void
{
	imagesXML = new XML(xmlLoader.data);
	trace(imagesXML.slide.filename);
}

```

# === here’s an XML sample they sent

```auto
<?xml version="1.0" encoding="utf-8"?>
<slides>
  <slide id="1">
    <filename>slide_showa_002.gif</filename>
    <order>1</order>
    <speakernotes>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah</speakernotes>
    <question>-Part4</question>
  </slide>
  <slide id="2">
    <filename>slide_showa_003.gif</filename>
    <order>2</order>
    <speakernotes>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
     </speakernotes>
    <question>Part5</question>
  </slide>
  <slide id="3">
    <filename>slide_showa_004.gif</filename>
    <order>3</order>
    <speakernotes>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
</speakernotes>
    <question>Part6</question>
  </slide>

  
  <!-- XXXXXXXXXXXXXXXXXXXX END TAG BELOW XXXXXXXXXXXXXXXXXXXXXXXXXXXX-->

  </slides>

```
