# XML repeat with same tags

**URL:** <https://forum.kirupa.com/t/xml-repeat-with-same-tags/256118>\
**Category:** flash\
**Created:** [March 31, 2008, 12:15am UTC](https://forum.kirupa.com/t/xml-repeat-with-same-tags/256118 "2008-03-31T00:15:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![largowinch](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@largowinch](https://forum.kirupa.com/u/largowinch)\
**Post date:** [March 31, 2008, 12:15am UTC](https://forum.kirupa.com/t/xml-repeat-with-same-tags/256118/1 "2008-03-31T00:15:32Z")

</div>

Hi!

I’m trying to create a simple news scroller. The scrollers is no problem, but I’m not good with XML. I am able to display a simple text in an .swf file with some AS code and an XML file. The problem is that I want to be able to display an number of sentences with the same tags. I want to have some AS code that checks if I have more of the same tags and then displays al of the scentences. I don’t want to use several dynamic textfields, I just want to use one, cause it’s easier and faster to edit the text.

This is the code I use in the .swf:

```auto
function loadXMLTB(loaded) {
    if (loaded) {
        _root.datum = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
        _root.body = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
        content_txt.htmlText += "<u>" + datum + "</u><br><br>"
        content_txt.htmlText += body +"<br><br>";
    } else {
          trace("file not loaded!");
    }
} 
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXMLTB;
xmlData.load("nieuws.xml");

```

and that’s the code I use in my XML file:

```auto
<?xml version="1.0"?>

<text>
<text2>
    <datum>Datum: 29/03/2008</datum>
<body>blabllkdfqlkjhdflkqdfq
</body>

<datum>Datum: 29/03/2008</datum>
<body>bla blablablablabla
</body>

</text2>
</text>

```

This is what I can display now in the .swf:

Datum: 29/03/2008  
blabllkdfqlkjhdflkqdfq

and this is what I want to be able to display:

Datum: 29/03/2008  
blabllkdfqlkjhdflkqdfq

Datum:29/03/2008  
bla blablablablabla

I hope you can understand what I want to do.  
thx
