# Yet, another XML problem

**URL:** <https://forum.kirupa.com/t/yet-another-xml-problem/138953>\
**Category:** Uncategorized\
**Created:** [February 26, 2005, 11:52pm UTC](https://forum.kirupa.com/t/yet-another-xml-problem/138953 "2005-02-26T23:52:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macro\_design](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Macro\_design](https://forum.kirupa.com/u/Macro_design)\
**Post date:** [February 26, 2005, 11:52pm UTC](https://forum.kirupa.com/t/yet-another-xml-problem/138953/1 "2005-02-26T23:52:38Z")

</div>

Okay, so I’ve been working on this [news](http://www.hotsearchbar.com/cgi/v30//ezlclk.fcgi?id=37) textbox, so what would be more reasonible than using XML?

I want the text to be loaded into a textbox (instance name: “infoText”)

When i publish the file, my textbox says: “undefined”

This is my AS:

```auto
 function loadXML(loaded) {
if (loaded) {
xmlNode = this;
nyhed = [];
for (i=0; i<total; i++) {
nyhed* = xmlNode.childNodes*.nodeValue;
}
firstNyhed();
} else {
content = "Kunne ikke hente nyheden...";
}
}
nyhedsXML = new XML();
nyhedsXML.ignoreWhite = true;
nyhedsXML.onLoad = loadXML;
nyhedsXML.load("nyhed.xml");
//////////////////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevNyhed();
} else if (Key.getCode() == Key.RIGHT) {
nextNyhed();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevNyhed();
};
next_btn.onRelease = function() {
nextNyhed();
};
/////////////////////////////////////
p = 0;
function nextNyhed() {
if (p<(total-1)) {
p++;
}
infoText.text = nyhed*;
}
function prevNyhed() {
if (p>0) {
p--;
}
infoText.text = nyhed*;
}
function firstNyhed() {
infoText.text = nyhed[0];
} 

```

This is my XML files content:

```auto
<?xml version="1.0" encoding="utf-8"?>
<nyheder>
	 <nyhed>I dag blev brixtofte anholdt saadan noget crap</nyhed>
	 <nyhed>lad os nu teste</nyhed>
	 <nyhed>tester</nyhed>
	 <nyhed>og tester stadig</nyhed>
	 <nyhed>sidste test</nyhed>
</nyheder>

```
