概述
function mOver(evt:MouseEvent):void{
myTextArea = evt.target as TextArea;
var lineHeight:Number;
if(myTextArea.getLineMetrics(0)!=null)
lineHeight = myTextArea.getLineMetrics( 0 ).height;
mChars = Math.ceil(myTextArea.length);
var textHeight:Number = myTextArea.textHeight;
numLines = Math.ceil( textHeight/lineHeight );
//overLine = myTextArea.getLineMetrics(mouseLine) as String;
vScrollPos = myTextArea.verticalScrollPosition;
mouseLine = Math.ceil( (myTextArea.mouseY )/lineHeight + myTextArea.verticalScrollPosition);
var tf:TextField = myTextArea.mx_internal::getTextField();
if((mouseLine>=1) && (mouseLine<=numLines))
overLine = tf.getLineText(mouseLine-1);
if(overLine.indexOf("tooltip") != -1)
myTextArea.toolTip = "这个是ToolTip";
else
myTextArea.toolTip = "";
//trace("lineHeight="+lineHeight);
}
最后
以上就是追寻麦片为你收集整理的TextArea mouseover 实现特定行 tooltip的全部内容,希望文章能够帮你解决TextArea mouseover 实现特定行 tooltip所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复