# Help loading xml into text fields

**URL:** <https://forum.kirupa.com/t/help-loading-xml-into-text-fields/217221>\
**Category:** flash\
**Created:** [February 24, 2007, 12:38pm UTC](https://forum.kirupa.com/t/help-loading-xml-into-text-fields/217221 "2007-02-24T12:38:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunReedr](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@sunReedr](https://forum.kirupa.com/u/sunReedr)\
**Post date:** [February 24, 2007, 12:38pm UTC](https://forum.kirupa.com/t/help-loading-xml-into-text-fields/217221/1 "2007-02-24T12:38:05Z")

</div>

When I test this I get ‘undefined’ in the preview window what did I do wrong ?

xml:

```auto

<?xml version="1.0" ?>
<logg>
        <title>My Logg </title>
        <description>How in the hell do I get this inside flash .</description>
    <item>
        <title>My Second Logg post</title>
        <description>A description of my Second Logg post</description>
        </item>
        <item>
        <title>My First logg post</title>
        <description>A description of my First Logg post</description>
        </item>
</logg>

```

AS:

```auto

function loadXML(loaded) {

if (loaded) {

_root.item = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.description = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
title_txt.text = _root.item;
description_txt.text = _root.description;
} else {
trace("file not loaded!");
  }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("my_logg.xml");

```
