Results 1 to 2 of 2

Thread: xml recognizing inner tags

  1. #1
    Join Date
    Aug 2007
    Location
    Harrisburg, PA
    Posts
    131
    Thanks
    6
    Thanked 9 Times in 9 Posts

    Default xml recognizing inner tags

    I'm having a strange issue with xml that i cant figure out. When I try to just trace out my xml it traces everything out fine without any problems. As soon as I try to trace out my inner tags or elements it doesn't error and it doesn't trace any thing out. heres what I have.

    Code:
    var imageXmlLoader:URLLoader = new URLLoader();
    var imageXmlRequest:URLRequest = new URLRequest("images.xml");
    
    
    imageXmlLoader.load(imageXmlRequest);
    imageXmlLoader.addEventListener(Event.COMPLETE, sortImageXML);
    
    function sortImageXML(e:Event)
    {
    	var imageXml:XML = new XML(imageXmlLoader.data);
    	trace(imageXml.imageList);
    	
    }
    here's my xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <imageList>
    	<image>images/full/001.jpg</image>
    	<image>images/full/002.jpg</image>
    	<image>images/full/003.jpg</image>
    	<image>images/full/004.jpg</image>
    	<image>images/full/005.jpg</image>
    	<image>images/full/006.jpg</image>
    	<image>images/full/007.jpg</image>
    	<image>images/full/008.jpg</image>
    </imageList>
    so when I just trace like this
    Code:
    trace(imageXml);
    it works fine and outputs the xml

    as soon as I try trace like this
    Code:
    trace(imageXml.imageList);
    it doesnt output anything and doesnt error anything.

    i've never had any problems doing it this way before, any one have any ideas?

  2. #2
    Join Date
    Aug 2007
    Location
    Harrisburg, PA
    Posts
    131
    Thanks
    6
    Thanked 9 Times in 9 Posts

    Default

    I found the answer. Because i was trying to trace out my first xml node imageList it wasn't working. I skipped the imageList and went right to image and it worked fine.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •