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
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
<?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.