troubleshooting Question

reading XML into an array

Avatar of kate_nixon
kate_nixon asked on
Adobe Flash
9 Comments1 Solution196 ViewsLast Modified:

I am trying to read some XML into an array and then use one of the variables in that array in a button to jump to a URL.  Can anyone see what I am doing wrong?
I am using Flash 5

In the first cell of the timeline of scene 1:

Function student(name, link, linktitle){
     this.name = name;
     this.link = link;
     this.linktitle = linktitle;
}

function readXML(){
var e = this.firstchild;
if (e.nodename == "JANE"){
     e = e.firstChild;
    jane = new Array();
     while (e != null) {
            var s = new student(e.attributes.name,
                             e.attributes.link,
                              e.attributes.linktitle);
           jane.push(s);
var k  = e.attributes.link
         e = e.nextsibling;

    }
       
}}


// read xml and display when loaded
moXML = new XML();  
moXML.onLoad = readXML;
moXML.load("Linksfl.xml");
stop();

the linksfl.xml file is in the same directory as the fla file

on the button:
on (release) {

     getURL (jane[0].link);
}

the XML:


<JANE>
<STUDENT NAME="Kate Nixon" LINK="http://www.uni-of-life.com" LINKTITLE="Kate's Site" />
</JANE>

when I click on the button nothing happens and it seems that there is nothing in the array although it definitely seems to be reading the XML file earlier.

Thanks

Kate
ASKER CERTIFIED SOLUTION
rootdir

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros