CSS in Flash through XML; roadblock :(
Hi there,
I've managed to learn alot of steps to getting to where I've gotten, but I can't seem to get it, and I'm at a dead end. What I'm trying to do is display CSS enhanced text in flash with an XML file. The problem is that when the text is in the given text box, it's not formatted, and only the 2nd entry is posted, even though tracing it displays the text perfectly.
Here is the flash:
Code:newsText.html = true;
newsText.wordWrap = true;
newsText.multiline = true;
newsText.label.condenseWhite = true;
newsStyle = new TextField.StyleSheet();
newsStyle.load("styles.css");
newsText.styleSheet = newsStyle;
newsContent = new XML();
newsContent.ignoreWhite = true;
newsContent.load("conglomeration.xml");
newsContent.onLoad = function(success) {
if (success) {
var news = newsContent.firstChild.firstChild;
var newsEntries = news.childNodes;
for (var e = 0; e<newsEntries.length; e++) {
currEntry = newsEntries[e];
newsText.text = currEntry.firstChild.firstChild.nodeValue+" > "+currEntry.firstChild.nextSibling.firstChild.nodeValue+"\n"+currEntry.firstChild.nextSibling.nextSibling.firstChild.nodeValue+"\n";
}
}
};
Here is the XML:
Code:<?xml version="1.0" encoding="UTF-8" ?>
<conglomeration>
<news>
<entry>
<entrydate>Jul.18.05</entrydate>
<entrytitle>First Entry</entrytitle>
<entrybody>
<![CDATA[First news entry will go here.]]>
</entrybody>
</entry>
<entry>
<entrydate>Jul.19.05</entrydate>
<entrytitle>Second Entry</entrytitle>
<entrybody>
<![CDATA[Second news entry will go here.]]>
</entrybody>
</entry>
</news>
</conglomeration>
and here is the CSS:
Code:entrydate {
color: #FF0000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
display: block;
}
entrytitle {
color: #0000FF;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
display: block;
}
entrybody {
color: #000000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
display: block;
}
I attached the files I used for this.
Thanks in advance for any help 
Attachments:
xmlcsshtml.zip
127.02 Kb, 73 views
