Flash as3:多行htmlText滚动选择文本

时间:2011-05-26 07:19:58

标签: flash actionscript-3 htmltext

多行htmlText滚动选择文本

它还滚动鼠标滚轮事件..

var css:StyleSheet = new StyleSheet();
css.parseCSS('.red-text{font-family:"Lucida Grande";color:#ED1C24;font-size:10;font weight:bold;leading:-8;}');                 

dynamicText.styleSheet = css;
dynamicText.antiAliasType = AntiAliasType.ADVANCED;
dynamicText.embedFonts = true;
dynamicText.multiline = true;
dynamicText.wordWrap = true;
dynamicText.htmlText = "<p class= 'red-text'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor consequat. </p>";

dynamicText.width = 450;
dynamicText.height = dynamicText.textHeight;

任何修复?

2 个答案:

答案 0 :(得分:2)

field.addEventListener(Event.SCROLL, _scroll);
function _scroll(e:Event):void
{
    e.target.scrollV = 0;
}

答案 1 :(得分:1)

您可以使用dynamicText.mouseWheelEnabled = false禁用滚轮。此外,您应该设置dynamicText.height = dynamicText.textHeight + 4;,因为文本字段在文本周围有一个2像素的填充(请参阅docs