>... no flippin way to specify the links in a TextArea to be blue.
I have the same problem with external stylesheets. In Flex 1.5 there
was a way to attach a:hover, a:link style from an external stylesheet
to a TextField (this is not a TextArea!) with:
var textField:TextField;
var styles = new TextField.StyleSheet();
styles.load('myStyles.css');
...
public function onLoad(success):Void{
if(success){
textField.htmlText = "hello <a href='helloWorld.html'>world</a>";
textField.styleSheet = styles;
}
}
But now in 2.0 I can't find a good solution too. 'StyleSheet' has
become a 'stand-alone' class. The 'load()' function is gone, instead
there is a function 'parseCSS()'. I can't get it to work properly:
private var cssSource:String =
'myTest{color:"#ff0000";}a:hover{color:"#00FF00";text-decoration:"underline";}body{fontFamily:"ThesisBolPla";size:"11";color:"#0000FF";}.heading{fontWeight:"bold";color:"#FF3300";}';
private var labelText:String = "<body><span class='heading'>Hello
world</span><br><a href='javascript:void'>and welcome</a> to the show.
<br>This is gonna be the <myTest>arkText</myTest> component</body>";
var style:StyleSheet = new StyleSheet();
style.parseCSS(cssSource);
label = new TextField();
label.width = 200;
label.autoSize = TextFieldAutoSize.LEFT;
label.embedFonts = true;
label.background = true;
label.border = true;
label.multiline = true;
label.styleSheet = style;
...
label.htmlText = labelText;
What works fine on TextFields is:
var style:StyleSheet = new StyleSheet();
var aHover:Object = new Object();
aHover.color="#FFCC33";
aHover.textDecoration = "underline";
style.setStyle("a:hover", aHover);
label = new TextField();
label.width = 200;
label.background = true;
label.multiline = true;
label.styleSheet = style;
But you want to load a css externally and you want to use a TextArea.
I have asked this also to Matt Horn from Adobe, but he hadn't the
slightest idea how to solve this...
--
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/