Hi,
I am setting styles for “a” and “h1” linked to an external file. The “a” and “a:hover” shows, but the h1 appears plain with no style. What am I doing wrong?? In the external file, I simply have :
<h1>H1 Title </h1>
and here is my AS code:
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest("external.txt");
var style:StyleSheet = new StyleSheet();
style.setStyle("h1", {fontSize:'25',color:'#000000'});
style.setStyle("a", {color: "#CC0000",fontStyle: "italic"});
style.setStyle("a:hover", {color:'#0000FF',textDecoration:'underline'});
function textLoaded(event:Event):void{
external_txt.htmlText = textLoader.data;
external_txt.styleSheet = style;
}
textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
Many many thanks!!