# Parsing XML to get different outputs

**URL:** <https://forum.kirupa.com/t/parsing-xml-to-get-different-outputs/149015>\
**Category:** Uncategorized\
**Created:** [May 25, 2005, 11:58am UTC](https://forum.kirupa.com/t/parsing-xml-to-get-different-outputs/149015 "2005-05-25T11:58:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imported\_mucho](https://avatars.discourse-cdn.com/v4/letter/i/3da27b/32.png) [@imported\_mucho](https://forum.kirupa.com/u/imported_mucho)\
**Post date:** [May 25, 2005, 11:58am UTC](https://forum.kirupa.com/t/parsing-xml-to-get-different-outputs/149015/1 "2005-05-25T11:58:31Z")

</div>

Hi all,

I`m trying to load different texts from one XML file into my pre-defined areas. It works with one text…I gt to my frame where the as below is and the text gets loaded. BUT how do I need to proceed if I want to go to another frame and have a different text loaded from the same XML file?

I don`t know if this is the best way to do this - so I`m open for suggestions.

Thanks in advance,  
m.

```auto
function loadXML(loaded) {
	if (loaded) {
		_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
		_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
		name_txt.text = _root.inventor;
		comment_txt.text = _root.interview_sunset;
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
stop();

```
