I need to pull [COLOR=darkgreen]data[/COLOR] from an xml array, then have it alternate listing the data in the same text box.
Here is the how I’m loading the XML:
loadXML = function (loaded) {
if (loaded) {
xmlNode = this.firstChild;
contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
txt_mc.txthead.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
txt_mc.txt.htmlText = datecom + xmlNode.childNodes[1].firstChild.nodeValue;
headerName.text = xmlNode.attributes.Name;
}
} else {
trace("Error loading XML");
}
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.toLoad == undefined) {
_root.toLoad = "dailylog.xml";
}
xmlData.load(_root.toLoad);
Here is my conceptual approach (but to no success):
// LOAD XML
loadXML = function (loaded) {
if (loaded) {
xmlNode = this.firstChild;
contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
txt_mc.txthead.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
for (i=0; i<total; i++) {
headline* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
copy_full* = xmlNode.childNodes*.childNodes[5].firstChild.nodeValue;
}
txt_mc.txt.htmlText = datecom + headline*+"
"+copy_full*;
}
}
} else {
trace("Error loading XML");
}
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.toLoad == undefined) {
_root.toLoad = "dailylog.xml";
}
xmlData.load(_root.toLoad);
Here is the result I need displayed in the texbox:
[HR][/HR]
FLASHBACK - OBAMA ON AIG BONUSES — (headline[0])
Obama talks about the executive bonues at AIG. He talks about how they are in [COLOR=darkgreen]financial[/COLOR] distress due to greed.
(021010OLDOBAMA01) Q… greed Time ¬ 16 seconds — (copy_full[0])
He talks about how it’s hard to understand how AIG awarded these bonues and how can they justify this to the taxypayers.
(021010OLDOBAMA02) Q… afloat Time ¬ 18 seconds — (copy_full[0])
Obama then says he is asking Sect. Geitherner to use every single possible way to block the bonuses.
(021010OLDOBAMA03) Q… applause Time ¬ 18 seconds — (copy_full[0])
BIDEN GAFFE - IRISH PM’S MOTHER — (headline[1])
Biden, talking about the mother of the Irish PM, says God rest her soul- oh wait, she’s still alive- God bless her soul! I gotta get this straight!
(031810BIDENGAFFE) Q…straight Time – 21 seconds — (copy_full[1])
ETC. — (headline[2])
ETC. — (copy_full[2])
ETC. — (headline[3])
ETC. — (copy_full[3])
[HR][/HR]
Here is a condensed version of the xml being loaded:
<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?>
<content>
<article>
<headline>FLASHBACK - OBAMA ON AIG BONUSES</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Obama flashback in March of 2009 on AIG and financial responsibility</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/ ObamaAIGSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/ObamaAIGBig.jpg</image_large>
<copy_full><![CDATA[<p>Obama talks about the executive bonues at AIG. He talks about how they are in financial distress due to greed.
<font color="#666666">(021010OLDOBAMA01) Q… greed Time ¬ 16 seconds</font><br>He talks about how it’s hard to understand how AIG awarded these bonues and how can they justify this to the taxypayers.
<font color="#666666">(021010OLDOBAMA02) Q… afloat Time ¬ 18 seconds</font><br>Obama then says he is asking Sect. Geitherner to use every single possible way to block the bonuses.
<font color="#666666">(021010OLDOBAMA03) Q… applause Time ¬ 18 seconds</font><br>He then makes sure to let everyone know that Sect Geithner is on the case and is going to get things solved.
<font color="#666666">(021010OLDOBAMA04) Q… last year Time ¬ 16 seconds</font><br>Obama then says that this is not just a matter of dollars and cents. It’s about fundamental values. He then talks about Americans meeting their responsibilities without bailouts or bonuses.
<font color="#666666">(021010OLDOBAMA05) Q… bonuses Time ¬ 20 seconds</font><br>Obama then talks about people forgoing pay so they can just keep their [COLOR=darkgreen]credit[/COLOR][COLOR=darkgreen]line[/COLOR] open and keep their mortgages.
<font color="#666666">(021010OLDOBAMA06) Q… a float Time ¬ 20 seconds</font><br>He says that the main thing that these people on “main street” want is for Wall Street to be held to the same standards.
<font color="#666666">(021010OLDOBAMA07) Q… again Time ¬ 20 seconds</font><br>Obama talks about how there should be some form of resolution mechanism that protects Americans and the financial system just in case this happens again.
<font color="#666666">(021010OLDOBAMA08) Q… as this Time ¬ 12 seconds</font><br>Obama then makes a joke about how he is choked up with angery.
<font color="#666666">(021010OLDOBAMA09) Q… here Time ¬ 10 seconds</font><br>He says that they, the government, have some form of resolution to deal with banks but with [COLOR=darkgreen]companies[/COLOR] like AIG, the government doesn’t.
<font color="#666666">(021010OLDOBAMA10) Q… here Time ¬ 23 seconds</font><br></p>]]></copy_full>
</article>
<article>
<headline>BIDEN GAFFE - IRISH PM’S MOTHER</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Biden stating the mother of the Irish PM is dead, when she’s very much alive.</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/BidenSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/BidenBig.jpg</image_large>
<copy_full>
<![CDATA[<p>Biden, talking about the mother of the Irish PM, says God rest her soul- oh wait, she’s still alive- God bless her soul! I gotta get this straight!
<font color="#666666">(031810BIDENGAFFE) Q…straight Time – 21 seconds</font><br></p>]]>
</copy_full>
</article>
<article>
<headline>CLINTON SAYS ISRAEL INSULTED USA</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Secretary of State Hillary Clinton says Israel insulted the United States with Jerusalem settlement announcement</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/HClintonSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/HClintonBig.jpg</image_large>
<copy_full><![CDATA[<p>Clinton says our ……etc, etc, etc.</p>]]>
</copy_full>
</article>
</content>
Any and all help on this is greatly appreciated. Thanks for taking a moment to help out a newbie!!!
Kumba