# Using HTML Tags within XML for Flash

**URL:** <https://forum.kirupa.com/t/using-html-tags-within-xml-for-flash/78930>\
**Category:** flash\
**Created:** [February 9, 2005, 5:37am UTC](https://forum.kirupa.com/t/using-html-tags-within-xml-for-flash/78930 "2005-02-09T05:37:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansour](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mansour](https://forum.kirupa.com/u/mansour)\
**Post date:** [February 9, 2005, 5:37am UTC](https://forum.kirupa.com/t/using-html-tags-within-xml-for-flash/78930/1 "2005-02-09T05:37:07Z")

</div>

Basic question:  
how do i use html font tags within xml?

```php
<?xml version="1.0" encoding="utf-8"?>
<images>
    <pic>
        <image>http://www.kirupa.com/developer/mx2004/pg/kresge.jpg</image>
        <caption><![CDATA[<b>Something</b>]]></caption>
    </pic>
    <pic>
        <image>http://www.kirupa.com/developer/mx2004/pg/stata.jpg</image>
        <caption>Stata Center</caption>
    </pic>
    <pic>
        <image>http://www.kirupa.com/developer/mx2004/pg/construction.jpg</image>
        <caption>Construction</caption>
    </pic>
    <pic>
        <image>http://www.kirupa.com/developer/mx2004/pg/dome.jpg</image>
        <caption>The Dome</caption>
    </pic>
    <pic>
        <image>http://www.kirupa.com/developer/mx2004/pg/structure.jpg</image>
        <caption>Structure</caption>
    </pic>
</images>

```

As you have noticed, i already tried the CDATA technique. Some one suggested that it was a problem with the Action Script.

here’s my actionscript:  
[AS]spacing = 10;  
picture.\_alpha = 0;  
function loadPict(pic) {  
picture.loadMovie(pic);  
picture.\_alpha = 0;  
var temp = this.createEmptyMovieClip(“tmp”, 9976);  
temp.onEnterFrame = function() {  
var t = picture.getBytesTotal(), l = picture.getBytesLoaded();  
preloader.\_visible = 1;  
preloader.preload\_bar.\_xscale = Math.round((l/t)_100);  
preloader.txtBox = Math.round((1/t)100);  
if (t != 0 && Math.round(l/t) == 1 && picture.\_width != 0) {  
var w = picture.\_width+spacing, h = picture.\_height+spacing;  
border.resizeMe(w, h);  
preloader.\_visible = 0;  
delete this.onEnterFrame;  
}  
};  
}  
MovieClip.prototype.resizeMe = function(w, h) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
picture.\_x = this.\_x-this.\_width/2+spacing/2;  
picture.\_y = this.\_y-this.\_height/2+spacing/2;  
picture.\_alpha += 10;  
if (picture.\_alpha\>100) {  
picture.\_alpha = 100;  
delete this.onEnterFrame;  
t;  
}  
}  
};  
};  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image = xmlNode.childNodes_.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
/////////////////////////////////////  
listen = new Object();  
listen.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
prevImage();  
} else if (Key.getCode() == Key.RIGHT) {  
nextImage();  
}  
};  
Key.addListener(listen);  
previous\_btn.onRelease = function() {  
prevImage();  
};  
next\_btn.onRelease = function() {  
nextImage();  
};  
/////////////////////////////////////  
p = 0;  
function nextImage() {  
if (p\<(total-1)) {  
p++;  
}  
loadPict(image[p]);  
desc\_txt.text = description[p];  
picture\_num();  
}  
function prevImage() {  
if (p\>0) {  
p–;  
}  
loadPict(image[p]);  
desc\_txt.text = description[p];  
picture\_num();  
}  
function firstImage() {  
loadPict(image[0]);  
desc\_txt.text = description[0];  
picture\_num();  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}[/AS]

this is the result of the above inside the text field:

> \<b\>Something\</b\>

exacly that, the tags are still there and no actions were done. same with font tags. :h:

please help =)
