How do I connect an external stylesheet to a textfield so the htmlText gets the right styles?
I have an Application:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="




http://www.adobe.com/2006/mxml
" xmlns:myText="*" layout="absolute">
<mx:Style source="main.css "/>
<myText:TextFieldExample />
</mx:Application>






That 'loads' an external stylesheet main.css:

body {
fontFamily : "ThesisBolPla";

leading : "-3";
}
.heading {
fontWeight :"bold";


color: "#FF3300";



}
a {
color:#f0037f;
}
a:link{
color:#f0037f;
text-decoration:underline;

}
a:hover{
color:#f0037f;
}
a:active{
color:#cccccc;

}


and creates the an instance of TextFieldExample:




package {
import mx.core.UIComponent;
import flash.text.TextField;


public class TextFieldExample extends UIComponent {



private var label:TextField;

private var labelText:String = "<body><span class='heading'>Hello world</span><br><a href=''>and welcome</a> to the show. </body>";







public function TextFieldExample() {
configureLabel();
setLabel(labelText);
}

public function setLabel(str:String):void {



label.htmlText
= str;
}

private function configureLabel():void {

label = new TextField();
label.width = 200;
label.embedFonts = true;


label.background
= true;
label.multiline = true;
label.styleSheet = HOW TO CONNECT TO THE CSS?;

addChild(label);
}
}
}

How do I connect the external stylesheet to the textfield so the htmlText gets the right style?



__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to