一、当鼠标浮上超链接时。改变一下超链接的颜色。
var tmp3_text:TextField=new TextField();
var style:StyleSheet = new StyleSheet();
tmp3_text.x=10;
tmp3_text.y=100;
tmp3_text.width=300;
tmp3_text.height=20;
style.setStyle(".style1",{color:'#000000',fontWeight:'bold'});//自定义样式一
style.setStyle(".style2",{color:'#ff0000',fontSize:'15'});//自定义样式二
style.setStyle("a:link", { color: '#006600', textDecoration: 'underline',fontSize:'12' });//超链接正常态
style.setStyle("a:hover",{color:'#003399',fontSize:'12'});//鼠标浮上超链接时变色
style.setStyle("a:visited",{color:'#990000',fontSize:'12'});//已访问的超链接
style.setStyle("a:active ",{color:'#000000',fontSize:'12'});//超链接在按下时的状态
tmp3_text.styleSheet = style;
tmp3_text.htmlText="<a href='#'>超链接</a>sdfwewe<span class='style1'>文本文本</span><span class='style2'> 看吧看吧</span>";
addChild(tmp3_text);
浙公网安备 33010602011771号