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!!