# XML Undefined Error

**URL:** <https://forum.kirupa.com/t/xml-undefined-error/278958>\
**Category:** flash\
**Created:** [January 8, 2009, 12:48am UTC](https://forum.kirupa.com/t/xml-undefined-error/278958 "2009-01-08T00:48:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![watto\_uk](https://avatars.discourse-cdn.com/v4/letter/w/f08c70/32.png) [@watto\_uk](https://forum.kirupa.com/u/watto_uk)\
**Post date:** [January 8, 2009, 12:48am UTC](https://forum.kirupa.com/t/xml-undefined-error/278958/1 "2009-01-08T00:48:18Z")

</div>

Hi

I am getting the following error “undefined” when trying to read xml data into a dynamic text box contained inside a movie clip in flash lite 2 . Im new to xml, can anyone shed any light on where i am going wrong? I can trace the data out from the XML file but in the text box it states undefined??

I am using the following code

```auto
defaultContent_mc.weatherDay1Btn.onRelease = buildWeatherReport;

var weatherData:XML = new XML
weatherData.ignoreWhite = true;
weatherData.load("weather.xml");

function buildWeatherReport (weatherXML:XML)
{
attachMovie("day1Report_mc", "day1", 1);
var newClip:MovieClip = this("day1Report_mc");
day1._y = 120.3 ;
day1._x = 0;
day1.day1Txt.text = weatherXML.firstChild.childNodes[0].attributes.day;
trace ("its worked");
}

```

This is my xml code

```auto
  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<weatherReport date="28 June, 2009">
    <forecast day ="Sunny. Highs in the lower 70s. Northwest winds around 5 mph becoming west around 10 mph in the afternoon" icon="sunny"/>
    <forecast day ="Partly cloudy with a slight chance of showers. Highs in the lower 70s. Chance of rain 20 percent." icon="cloudy"/>
    <forecast day ="Sunny. Highs in the lower 70s. Northwest winds around 5 mph becoming west around 10 mph in the afternoon" icon="sunClouds"/>
    <forecast day ="Mostly sunny. Highs in the lower 70s. North winds around 5 mph becoming northeast in the afternoon." icon="sunClouds"/>
    <forecast day ="Partly sunny. Highs in the upper 60s." icon="sunny"/>
</weatherReport>

```

Many thanks

Liam.
