TextLine 与 buttonMode

来源:互联网 发布:foxit pdf editor mac 编辑:程序博客网 时间:2024/06/07 21:50

执行下面代码,你会发现当鼠标移入TextLine区域时,光标变成手型。这与预期相反。

怀疑这是AS的Bug。

当把 s.mouseChildren=false; 有效后,光标不再变成手型。

package {import flash.display.Sprite;import flash.text.engine.ElementFormat;import flash.text.engine.FontDescription;import flash.text.engine.TextBlock;import flash.text.engine.TextElement;import flash.text.engine.TextLine;public class aaa extends Sprite {public function aaa():void {this.buttonMode = true;  this.useHandCursor = false;     //不显示手型光标var str:String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, ";var fontDescription:FontDescription = new FontDescription();var textBlock:TextBlock = new TextBlock();var format:ElementFormat = new ElementFormat(fontDescription, 12);var textElement:TextElement = new TextElement(str, format);textBlock.content = textElement;var textLine:TextLine = textBlock.createTextLine(null, 500);textLine.y = 20;var s:Sprite = new Sprite();s.buttonMode = false; s.useHandCursor = false;     //不显示手型光标//s.mouseChildren=false;s.x=s.y=30 ;addChild(s);s.addChild(textLine);}}    }


0 0
原创粉丝点击