# Linking Text read from XML

**URL:** <https://forum.kirupa.com/t/linking-text-read-from-xml/62299>\
**Category:** flash\
**Created:** [August 26, 2004, 5:33pm UTC](https://forum.kirupa.com/t/linking-text-read-from-xml/62299 "2004-08-26T17:33:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeep](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@sandeep](https://forum.kirupa.com/u/sandeep)\
**Post date:** [August 26, 2004, 5:33pm UTC](https://forum.kirupa.com/t/linking-text-read-from-xml/62299/1 "2004-08-26T17:33:47Z")

</div>

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.

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2004, 10:59am UTC](https://forum.kirupa.com/t/linking-text-read-from-xml/62299/2 "2004-08-27T10:59:24Z")

</div>

could someone please help out?
