Problem
Need add css for loaded html content
Solution
Using URLRequest and URLLoader. Also using methods parseCSS and styleSheet.
Detailed explanation
as code:
var myTextObject:URLRequest=new URLRequest("my_content.txt");
var myLoaderObject:URLLoader = new URLLoader();
var myCssObject:URLRequest=new URLRequest("style.css");
var myCssLoaderObject:URLLoader = new URLLoader();
myLoaderObject.addEventListener(Event.COMPLETE,
myContentWasLoaded);
myLoaderObject.load(myTextObject);
myCssLoaderObject.addEventListener(Event.COMPLETE, myCssWasLoaded);
myCssLoaderObject.load(myCssObject);
function myContentWasLoaded(e:Event):void {
myContent_txt.htmlText=myLoaderObject.data;
}
function myCssWasLoaded(e:Event):void {
var myCss:StyleSheet= new StyleSheet();
myCss.parseCSS(myCssLoaderObject.data);
myContent_txt.styleSheet=myCss;
}
css code:
a {
color: #ff0000;
}
a:hover {
color: #9C09C0
}

Source:
slyling_loaded_html_content
