Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
galera, to fazendo uma espécie de tooltip e quero que com no MOUSEOUT o label e tudo mais sejam apagados, to tentando usar o removechild, ja li varios topicos a respeito mas não funciona, me ajudem plz!!
MC.mcleg1.addEventListener(MouseEvent.ROLL_OVER, Tooltip);
MC.mcleg1.addEventListener(MouseEvent.ROLL_OUT, OutTooltip);
var ybut:Number = MC.mcleg1.y
var xbut:Number = MC.mcleg1.x
trace (ybut);
trace (xbut);
function Tooltip (event:MouseEvent):void {
background = new Shape();
background.graphics.beginFill(0x55ffff);
background.graphics.drawRect(xbut,ybut,100,20)
background.graphics.endFill();
addChild(background);
label_txt = new TextField();
label_txt.selectable = false;
label_txt.defaultTextFormat = new TextFormat( 'Verdana', 10, 0x000000 );
addChild(label_txt);
visible = true;
mouseEnabled = false;
label_txt.text = "TEXTO DO TOOLTIP";
setlabel (descr);
}
function setlabel ( s: String ) : void {
label_txt.autoSize = TextFieldAutoSize.LEFT;
label_txt.width = 200;
label_txt.multiline = label_txt.wordWrap = true;
background.width = Math.max( 100, label_txt.textWidth + 10);
background.height = label_txt.textHeight + 18;
background.y = ybut + Math.round( -background.height - 16);
background.x = 1 + xbut;
label_txt.y = background.y + 4;
label_txt.x = xbut + 4
graphics.clear();
graphics.lineStyle(0,0x000000);
graphics.beginFill(0x55ffff);
graphics.moveTo(xbut,ybut);
graphics.lineTo(background.x-1,background.y+background.height+1);
graphics.lineTo(background.x-1,background.y-1);
graphics.lineTo(background.x+background.width+1,background.y-1);
graphics.lineTo(background.x+background.width+1,background.y+background.height+1);
graphics.lineTo(background.x+10,background.y+background.height+1);
graphics.lineTo(xbut,ybut);
}
function OutTooltip (event:MouseEvent):void {
this.removeChild(label_txt);
this.removeChild(background);
}Carregando comentários...