0

多行 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;

任何修复?

4

2 回答 2

2
field.addEventListener(Event.SCROLL, _scroll);
function _scroll(e:Event):void
{
    e.target.scrollV = 0;
}
于 2011-05-26T07:26:11.937 回答
1

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

于 2011-05-26T07:27:44.407 回答