# Preloading XML - textVar HELP

**URL:** <https://forum.kirupa.com/t/preloading-xml-textvar-help/195715>\
**Category:** flash\
**Created:** [August 2, 2006, 4:08pm UTC](https://forum.kirupa.com/t/preloading-xml-textvar-help/195715 "2006-08-02T16:08:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srx](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/srx/32/2655_2.png) [@srx](https://forum.kirupa.com/u/srx)\
**Post date:** [August 2, 2006, 4:08pm UTC](https://forum.kirupa.com/t/preloading-xml-textvar-help/195715/1 "2006-08-02T16:08:26Z")

</div>

I have just finished making news page using XML load function.  
When I tried to look what I have done I notise that in the text field instead of showing news it has full text from XML file including \<tags\>. When I refresh page it was ok so I think it is preloading problem.  
Can somebody hel me?

The code I used follows (I think I picked up this code from this pages):

var myText;  
function xmlLoad(newXml, cssUrl) {  
myText.setStyle(“background”, false);  
myText.setStyle(“backgroundColor”, 0xFFFFFF);  
myText.html = true;

```
var xmlCss:TextField.StyleSheet = new TextField.StyleSheet();
xmlCss.onLoad = function(success) {
    if (success) {
        myText.styleSheet = xmlCss;
    } else {
        myText.text = "Stylesheet not loaded!";
    }
};
xmlCss.load(cssUrl);

var menuXML:XML = new XML();
menuXML.load(newXml);
menuXML.ignoreWhite = true;
menuXML.onLoad = function(success) {
    if (success) {
        myText.text = this.firstChild;
    }
};

```

}  
xmlLoad(“data/news.xml”, “css/body.css”);

Thanks in advanse!!
