Hi all,
I’m setting up a row of thumbnails that will show a tooltip TextFormat object on rollover.
thumbContainer.addEventListener(MouseEvent.MOUSE_OVER,showTitle);
function showTitle(e : MouseEvent ):void {
var thumb:MovieClip=e.currentTarget as MovieClip;
var myFormat:TextFormat = new TextFormat();
myFormat.font=myFont.fontName;
myFormat.size=12;
myFormat.color=0xFFFFFF;
myFormat.letterSpacing=0;
tooltipTxt.autoSize=TextFieldAutoSize.CENTER;
tooltipTxt.defaultTextFormat=myFormat;
tooltipTxt.embedFonts=true;
tooltipTxt.selectable=false;
tooltipTxt.text=thumb.titleTxt;
addChild(tooltipTxt);
tooltipTxt.alpha=0;
tooltipTxt.x=thumb.x+thumb.width;
TweenLite.to(tooltipTxt,0.5,{alpha:1,ease:Quint.easeInOut});
}
However when the screen is resize and the thumbnails are repositioned. The tooltips are still referencing to the old position. I tried to ‘refresh’ the positions by adding the same EventListener again on resize. But didn’t work
Any pointers would be great! Thanks in advance!
public function resizeStage(evt:Event) {
container_mc.y=stage.stageHeight-100;
container_mc.x=stage.stageWidth/2 - (1050/2);
//reset thumbnail position by refreshing event listeners
for (var i:Number=0; i<container_mc.numChildren; i++) {
container_mc.getChildAt(i).addEventListener(MouseEvent.MOUSE_OVER,showTitle);
}
}