# Dynamic xml text help

**URL:** <https://forum.kirupa.com/t/dynamic-xml-text-help/251577>\
**Category:** Uncategorized\
**Created:** [February 10, 2008, 4:56pm UTC](https://forum.kirupa.com/t/dynamic-xml-text-help/251577 "2008-02-10T16:56:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zenor](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/zenor/32/3634_2.png) [@Zenor](https://forum.kirupa.com/u/Zenor)\
**Post date:** [February 10, 2008, 4:56pm UTC](https://forum.kirupa.com/t/dynamic-xml-text-help/251577/1 "2008-02-10T16:56:37Z")

</div>

Hello everyone.

I have some trouble with a dynamic xml text project.  
I am using the following xml:

```auto

<?xml version="1.0"?>

<About>
   <box>
      <title>[COLOR=Red]My Work[/COLOR]</title>
      <comment>[COLOR=DarkOrange]Text Here[/COLOR].</comment>
   </box>
   <box>
      <title>[COLOR=DeepSkyBlue]My Photographs[/COLOR]</title>
      <comment>[COLOR=Plum]Text Here[/COLOR].</comment>
   </box>
</About>

```

Now.On flash:  
I have four dynamic text fields.  
The one is called title1\_txt(which is for “[COLOR=Red]My Work[/COLOR]” title).  
The other one is called box1\_txt(which is for “[COLOR=DarkOrange]Text Here[/COLOR]” comment).  
These work just fine with the ActionScript I am going to link to you.  
\*\*  
What I want to achieve\*\*: title2\_txt( I want it to be “[COLOR=DeepSkyBlue]My Photographs[/COLOR]” title).  
box2\_txt( I want it to be “[COLOR=Plum]Text Here[/COLOR]” comment).

What do I have to edit on the following ActionScript in order to do that?

```auto

function loadXML(loaded) {

if (loaded) {

_root.About = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
title1_txt.text = _root.About;
box1_txt.text = _root.comments;
[COLOR=Red] title2_txt.text = _root.About;[/COLOR]
[COLOR=Red] box2_txt.text = _root.comments;[/COLOR]
} else {
  trace("file not loaded!");

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("About.xml");

```

Thanks in advance 🙂
