Question
Dynamic text with css issues
Im trying to format some externally loaded text with CSS. I
have a dynamic textbox on stage, with the instance name "myText1",
the content Im loading is coming from an XML file called "main.xml"
and Im trying to format it with a stylesheet called "flash.css".
The problem Im getting is one of two. The first problem is, that unless I paste the code directly onto the frame from another movie that Im working on with css (which works I might add), it doesnt format the text at all, and it just literally pastes the XML into the textbox all in one line, tags and all. Ive tried typing out the code word for word, but it does the same thing unless I paste it in. Its really weird and extremely frustrating!
The second problem is, once ive actually got it to read the XML properly, it will format my text content, with the exception of the Font-family. If i put a font-family property in my CSS it doesnt display the text, if I leave the font-family out, it works fine for color, size, weight etc, but font-family just causes it to show a blank box. Again this is really weird and its drinving me nuts!
Any ideas would be greatly appreciated.
My Xml looks like this:
<content>
<title>Test</title>
<article>Test Article 1 yeeeeah, this is definitely a test article, if it wasnt it wouldnt be called test now would it!</article>
</content>
<content>
<title>Test2</title>
<article>Here is another test for the main area</article>
</content>
<content>
<title>Test 6</title>
<article>This is a test article</article>
</content>
My CSS looks like this:
title{
color:#FF0000;
font-size:20;
font-weight:bold;
letter-spacing:-1px;
text-decoration:none;
}
article{
font-family:"Arial, Helvetica, sans-serif";
color:#000000;
font-size:12;
font-weight:normal;
letter-spacing:;
text-decoration:none;
}
And this is the code Im using to load and format the XML:
The problem Im getting is one of two. The first problem is, that unless I paste the code directly onto the frame from another movie that Im working on with css (which works I might add), it doesnt format the text at all, and it just literally pastes the XML into the textbox all in one line, tags and all. Ive tried typing out the code word for word, but it does the same thing unless I paste it in. Its really weird and extremely frustrating!
The second problem is, once ive actually got it to read the XML properly, it will format my text content, with the exception of the Font-family. If i put a font-family property in my CSS it doesnt display the text, if I leave the font-family out, it works fine for color, size, weight etc, but font-family just causes it to show a blank box. Again this is really weird and its drinving me nuts!
Any ideas would be greatly appreciated.
My Xml looks like this:
<content>
<title>Test</title>
<article>Test Article 1 yeeeeah, this is definitely a test article, if it wasnt it wouldnt be called test now would it!</article>
</content>
<content>
<title>Test2</title>
<article>Here is another test for the main area</article>
</content>
<content>
<title>Test 6</title>
<article>This is a test article</article>
</content>
My CSS looks like this:
title{
color:#FF0000;
font-size:20;
font-weight:bold;
letter-spacing:-1px;
text-decoration:none;
}
article{
font-family:"Arial, Helvetica, sans-serif";
color:#000000;
font-size:12;
font-weight:normal;
letter-spacing:;
text-decoration:none;
}
And this is the code Im using to load and format the XML: