# AS2 - Arrays to textbox

**URL:** <https://forum.kirupa.com/t/as2-arrays-to-textbox/327187>\
**Category:** flash\
**Created:** [February 11, 2012, 4:22pm UTC](https://forum.kirupa.com/t/as2-arrays-to-textbox/327187 "2012-02-11T16:22:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumba](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kumba](https://forum.kirupa.com/u/kumba)\
**Post date:** [February 11, 2012, 4:22pm UTC](https://forum.kirupa.com/t/as2-arrays-to-textbox/327187/1 "2012-02-11T16:22:26Z")

</div>

I need to pull [[COLOR=darkgreen]data[/COLOR]](http://board.flashkit.com/board/showthread.php?p=4296287#) 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:

```auto

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):

```auto
// 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]](http://board.flashkit.com/board/showthread.php?p=4296287#) 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]](http://board.flashkit.com/board/showthread.php?p=4296287#) 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]](http://board.flashkit.com/board/showthread.php?p=4296287#) 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
