Jul 17, 2009

Flex Underline Links in a TextArea Component

import flash.text.StyleSheet;

private function init():void {
var ss:StyleSheet = new StyleSheet;

// Define an object for the "hover" state of the "a" tag.
var hoverStyles:Object = new Object;
hoverStyles.textDecoration = "underline";
hoverStyles.color = "#FF00CC";

// Define an object for the non-hover state of the "a" tag.
var linkStyles:Object = new Object;
linkStyles.color = "#FF00CC";

// Apply the newly defined styles.
ss.setStyle("a:hover", hoverStyles);
ss.setStyle("a", linkStyles);

// Apply the StyleSheet to the TextArea control.
myTA.styleSheet = ss;
}

No comments: