[Tweener] Loading images via xml

Gerry Creighton gerry at thespikeranch.com
Sat Oct 4 07:57:39 PDT 2008


Oh ok...
So what is itemList? How do you want the images to display? The data  
is loaded but now
you need code to load each image in some way. Is itemList a movieClip  
with a List component
in it? I'm trying to figure out how you are trying to load and display  
each image.

-Gerry


On Oct 4, 2008, at 10:26 AM, Philip Ames wrote:

> Hi Gerry, thanks for your response. I'm using AS2 but didn't get  
> much help
> from the help section.
>
> I'm using the following slice of code to try and pull in the XML on  
> the
> first frame of itemList, which is a child of the main stage...
> ---------------------
> var myXML:XML = new XML();
> myXML.ignoreWhite=true;
> myXML.load("images.xml");
> myXML.onLoad = function(success) {
>    if (success) {
>    var myImage = myXML.firstChild.childNodes;
>    for (i=0; i<myImage.length; i++) {
>        var imageNumber = i+1;
>        var imageName = myImage[i].attributes.title;
>        var imageURL = myImage[i].firstChild.nodeValue;
>        trace ("Image number is "+imageNumber+", is titled "+imageName 
> +" and
> is located in "+imageURL+".")
>        }
>    }
> };
> ---------------------
> And my XML is set up...
> ---------------------
> <gallery>
> <image title="image1">images/1.jpg</image>
> <image title="image2">images/2.jpg</image>
> <image title="image3">images/3.jpg</image>
> <image title="image4">images/4.jpg</image>
> <image title="image5">images/5.jpg</image>
> </gallery>
> ---------------------
>
> The trace returns everything it is supposed to, but the images do  
> not load.
> I've checked the paths and they are correct.
>
> Any notions of what I'm doing wrong?
>
> Thanks in advance
>
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com



More information about the Tweener mailing list