# Array challenged (xml to array)

**URL:** <https://forum.kirupa.com/t/array-challenged-xml-to-array/164823>\
**Category:** flash\
**Created:** [October 5, 2005, 5:28am UTC](https://forum.kirupa.com/t/array-challenged-xml-to-array/164823 "2005-10-05T05:28:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhidbeyTomas](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@WhidbeyTomas](https://forum.kirupa.com/u/WhidbeyTomas)\
**Post date:** [October 5, 2005, 5:28am UTC](https://forum.kirupa.com/t/array-challenged-xml-to-array/164823/1 "2005-10-05T05:28:54Z")

</div>

I read the excellent tutorial included on this site, but I am afraid that I am too stupid to genearalize the content and parse it to a new problem. I just don’t get it. I have tried to get it, for days and days I’ve tried. But I really don’t.

I just can’t make this work. I understand arrays in theory, but apparently not in code. Because what I am doing just isn’t working.

My xml document is pretty simple  
\<tool1\>  
\<section type=“st”\>  
\<TopHeading\>Intro\</TopHeading\>  
\<subHeading\>Scenario\</subHeading\>  
\<content\>Twenty words\</content\>  
\<subHeading\>Discussion\</subHeading\>  
\</section\>  
\<section type=“b1”\>  
\<TopHeading\>Syntax\</TopHeading\>  
\<subHeading\>Options\</subHeading\>  
\<content\>Twenty words\</content\>  
\<subHeading\>Discussion\</subHeading\>  
\<content\>Twenty words\</content\>  
\</section\>  
\<section type=n\>  
\</section\>  
\</tool\>

I was able to load this file and display it, but now that I need to parse it, I can’t make anything show.  
This is what I am doing, can someone, anyone tell me what is wrong?  
Also, if someone can explain this array process so I can understand it, I would be very gratefull (but hey, I’m really asking too much now).

Here is the code that in my ignorance and naivety, I had so hoped would make my day. But after about seven hours (today), websites, books, and lost hair, I am as stumped now as I was when I started.

//init TextArea component  
content\_txt.html = true;  
content\_txt.wordWrap = true;  
content\_txt.multiline = true;  
content\_txt.label.condenseWhite=true;  
Textarea\_Instance.condenseWhite=true;  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
//load css  
modStyle = new TextField.StyleSheet();  
modStyle.load(“Mod.css”);  
content\_txt.styleSheet = modStyle;

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
//load in XML  
modContent = new XML();  
modContent.ignoreWhite = true;  
modContent.load(“Mod1.xml”);

ModContent.onLoad = function(success){  
if (success){  
var Mod1Content = this.firstChild.firstChild.nodeName;  
content\_exe.html = Mod1Content [0];

}else{ content\_txt.text = “Error loading XML”;  
}  
};  
//this brings no joy
