执行下面代码,你会发现当鼠标移入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);
}
}
}