# Appendable XML-To-Flash News Section AS 2.0

**URL:** <https://forum.kirupa.com/t/appendable-xml-to-flash-news-section-as-2-0/252736>\
**Category:** flash\
**Created:** [February 22, 2008, 11:03pm UTC](https://forum.kirupa.com/t/appendable-xml-to-flash-news-section-as-2-0/252736 "2008-02-22T23:03:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![K9Damien](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@K9Damien](https://forum.kirupa.com/u/K9Damien)\
**Post date:** [February 22, 2008, 11:03pm UTC](https://forum.kirupa.com/t/appendable-xml-to-flash-news-section-as-2-0/252736/1 "2008-02-22T23:03:39Z")

</div>

I’ve been looking everywhere for a tutorial or a solution to this problem that I’ve come across.

I am able to build XML files that load into Flash and are displayed properly. Where my problem lies, is once I get into Arrays and storing the data into those arrays. What I am trying to build is a news section for a website that you typically see on band websites. I would like to build it so that new entries can be added to the news.xml file and will be displayed within the Flash file.

My XML file looks like this:

\<?xml version=“1.0” encoding=“iso-8859-1”?\>  
\<news\>  
\<entry\>  
\<date\>September 31, 2069\</date\>  
\<title\>Band News Section\</title\>  
\<info\>This is where you will type in the news about the post that you are typing.\</info\>  
\<posted\_by\>Your name or the band name\</posted\_by\>  
\</entry\>  
\<entry\>  
\<date\>September 30, 2069\</date\>  
\<title\>Band News Section\</title\>  
\<info\>This is where you will type in the news about the post that you are typing.\</info\>  
\<posted\_by\>Your name or the band name\</posted\_by\>  
\</entry\>  
\</news\>

I have a movieclip in Flash that has the dynamic text fields set up and it is loading one entry into Flash right now.

My Flash code looks like this:

xmlContent = new XML();  
xmlContent.ignoreWhite = true;  
xmlContent.onLoad = loadXML;  
xmlContent.load(“news.xml”);  
//XML Load  
function loadXML(loaded) {  
if (loaded) {  
\_root.date = this.firstChild.firstChild.childNodes[0].firstChild.nodeValue;  
\_root.title = this.firstChild.firstChild.childNodes[1].firstChild.nodeValue;  
\_root.info = this.firstChild.firstChild.childNodes[2].firstChild.nodeValue;  
\_root.posted\_by = this.firstChild.firstChild.childNodes[3].firstChild.nodeValue;  
news\_mc.date.text = \_root.date;  
news\_mc.title.text=\_root.title;  
news\_mc.info.text=\_root.info;  
news\_mc.posted\_by.text=\_root.posted\_by;

} else {  
trace(“error loading content”);  
}  
}

I understand that I must set a loop and store the data for each entry as a variable…but like most, I have no clue how to code it.

If anyone has the solution with a brief explanation, or a link to a tutorial, I would very much appreciate it.

Thank you ahead of time!
