AS3テキストにCSSを反映させる

[sourcecode language=”java”]/*
* リンク付き文字に対して、hoverで線を表示させる
* 表示させるテキストフィールドのインスタンス名はtest_txt
*/

// スタイルシートオブジェクトを作成
var style:StyleSheet = new StyleSheet( );
style.setStyle( "a:link", { textDecoration:"none" } );
style.setStyle( "a:hover", { textDecoration:"underline" } );
style.setStyle( "a:active", { textDecoration:"none" } );

// テキストフィールドに適応
test_txt.htmlText = "<a href=’http://www.google.co.jp/’>google</a>";
test_txt.styleSheet = style; [/sourcecode]