<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="init();" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
private var styleSheet:StyleSheet;
private function init():void {
httpService.send();
}
private function httpService_result(evt:ResultEvent):void {
var css:String = evt.result as String;
styleSheet = new StyleSheet();
styleSheet.parseCSS(css);
textArea.styleSheet = styleSheet;
}
private function textArea_link(evt:TextEvent):void {
Alert.show("text: " + evt.text, "Panel");
}
]]>
</mx:Script>
<mx:HTTPService id="httpService"
url="styles.css"
resultFormat="text"
result="httpService_result(event);" />
<mx:String id="txt" source="text.html" />
<mx:TextArea id="textArea"
htmlText="{txt}"
editable="false"
condenseWhite="true"
width="100%"
height="100%"
link="textArea_link(event);" />
</mx:Application>