External CSS loading problem
This my hole code
AS3 code:
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("linkNewD.xml"));
var cssLoader:URLLoader = new URLLoader();
cssLoader.load(new URLRequest("style.css"));
cssLoader.addEventListener(Event.COMPLETE, onCSSFileLoaded);
function onCSSFileLoaded(event:Event):void
{
var st:StyleSheet = new StyleSheet();
st.parseCSS(cssLoader.data);
trace(cssLoader.data);
myMc1.opt1txt.styleSheet =st;
}
When I am trace this (trace(cssLoader.data);) I got this css
".a {color: '#6a4100', text-decoration: 'none';}
.a:link { color: '#333333', textDecoration: 'none'; }
.a:hover {color: '#b30000', text-decoration: 'none';}"
but not Appling to the test field why?
xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
function displayHTML(e:Event):void {
var xmlData:XML = new XML(e.target.data);
myMc1.opt1txt.htmlText = xmlData.Header1.option.*;
}
External CSS code:
.a {color: '#6a4100', text-decoration: 'none';}
.a:link { color: '#333333', textDecoration: 'none'; }
.a:hover {color: '#b30000', text-decoration: 'none';}
XML code:
<data>
<Header1>
<title>Title one</title>
<option>
<![CDATA[<b>Option Title</b><br>]]>
<![CDATA[<a href="http://www.google.com">Google Search</a><br>]]>
<![CDATA[<a href="http://www.yahoo.com">Yahoo Search</a><br>]]>
<![CDATA[<a href="http://www.bing.com">Bing search</a>]]>
</option>
</Header1>
</data>
Please help me!
Thanks,
jafy