/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var cssLoader:URLLoader = new URLLoader(); var cssRequest:URLRequest = new URLRequest("content.css"); var sheet:StyleSheet = new StyleSheet(); cssLoader.load(cssRequest); cssLoader.addEventListener(Event.COMPLETE, cssLoadComplete); function cssLoadComplete(event:Event):void { //trace(cssLoader.data); sheet.parseCSS(cssLoader.data); // Now assign the StyleSheet to a text field for example textBox.styleSheet = sheet; //textBox.text = styles.texttitle; // Now you would load any external text or html into // the text field }