I went through this tutorial and i pretty much understood how to extract data from nodes.
I got a few questions though. (I’m new to flash and AS)
How do you apply a getURL to a text? if i use “getURL” as such, it opens the page without being clicked on. And if i use onRelease, it’ll cause an error because i don’t have any buttons.
function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[0].childNodes[8].childNodes[2].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[8].childNodes[0].firstChild.nodeValue;
_root.link = this.firstChild.childNodes[0].childNodes[8].childNodes[2].firstChild.nodeValue;
name_txt.text = _root.inventor;
comment_txt.text = _root.comments;
[COLOR=Red]**getURL(_root.link);**[/COLOR]
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml");
I’m used to java so i can pick up some things fast. If thats used in the AS template from the tutorial it works pretty well except that the link opens up without it being clicked on. I’d like to learn how to link a piece of text.
Secondly, from the RSS there are several such links, how would i go about a for loop? or an If statement? Could i do something like “if nodeName = URL” do something?
I’m just curious thats all. Could someone please explain?
Cheers