# How to load html data from xml file

**URL:** <https://forum.kirupa.com/t/how-to-load-html-data-from-xml-file/263551>\
**Category:** flash\
**Created:** [June 17, 2008, 5:01am UTC](https://forum.kirupa.com/t/how-to-load-html-data-from-xml-file/263551 "2008-06-17T05:01:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devendra\_Singh](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Devendra\_Singh](https://forum.kirupa.com/u/Devendra_Singh)\
**Post date:** [June 17, 2008, 5:01am UTC](https://forum.kirupa.com/t/how-to-load-html-data-from-xml-file/263551/1 "2008-06-17T05:01:44Z")

</div>

Hi all,

plz help me out…

how can i load html data in swf which will come through xml file…

soo whats the code of xml to load html data

here is my code which i put on my first frame of my movie

```auto
 
import mx.transitions.Tween;
import mx.transitions.easing.*;
xmlData = new XML ();
xmlData.ignoreWhite = true;
var entry = 0;
var total = 0;
function ShowContent ()
{
 new Tween (textBox_left, "_alpha", Strong.easeOut, 0, 100, 20, true);
 new Tween (textBox_right, "_alpha", Strong.easeOut, 0, 100, 20, true);
 textBox_left.htmlText = xmlData.firstChild.childNodes[entry].childNodes[0].childNodes[0].nodeValue;
 textBox_right.htmlText = xmlData.firstChild.childNodes[entry].childNodes[1].childNodes[0].nodeValue;
 total = xmlData.firstChild.childNodes.length;
}
xmlData.onLoad = ShowContent;
xmlData.load ("contacts.xml");
stop ();

```

and here is my xml file code

```auto
 
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<MM>
<images>
<left><img src='a.jpg'/></left>
<right><![CDATA[Text 1 will be display here]]></right>
</images>
<images>
<left><![CDATA[<img src='b.jpg' />]]></left>
<right><![CDATA[Text 2 will be display here]]></right>
</images>
<images>
<left><![CDATA[<img src='c.jpg' />]]></left>
<right><![CDATA[Text 3 will be display here]]></right>
</images>
</MM>

```

the one more problem is that when i load swf file from xml file it is not working…

plz help me asap

---

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [June 18, 2008, 5:42am UTC](https://forum.kirupa.com/t/how-to-load-html-data-from-xml-file/263551/2 "2008-06-18T05:42:48Z")

</div>

first of all

xmlData.firstChild.childNodes[**entry**].childNodes[1].childNodes[0].nodeValue;

is invalid - there is no such thing as childNodes[entry]
