use the code above... its the same no matter how you apply it..I just chose to output it a textField..and use THAT as the button/link..
Code:
var myXML:XML = new XML("<links><link>http://www.nike.com</link><link>http://www.google.com</link><link>http://www.yahoo.com</link></links>");
trace("WHOLE XML: "+myXML);
/////
trace(newline);
////
//link1 node
trace("Full Link Node: "+myXML.firstChild.childNodes[0]);
trace("Link Node Name: "+myXML.firstChild.childNodes[0].nodeName);
trace("Link Value: "+myXML.firstChild.childNodes[0].firstChild.nodeValue);
link1 = myXML.firstChild.childNodes[0].firstChild.nodeValue;
/////
trace(newline);
////
//link2 node
trace("Full Link Node: "+myXML.firstChild.childNodes[1]);
trace("Link Node Name: "+myXML.firstChild.childNodes[1].nodeName);
trace("Link Value: "+myXML.firstChild.childNodes[1].firstChild.nodeValue);
link2 = myXML.firstChild.childNodes[1].firstChild.nodeValue
now on your buttons you could have:
button1:
Code:
on(press) {
getURL(link1);
}
button2:
Code:
on(press) {
getURL(link2);
}
same as doing:
button1:
Code:
on(press) {
getURL(myXML.firstChild.childNodes[0].firstChild.nodeValue);
}
and this is exactly what I just posted before... unless I am missing something?