Hi!
I’m trying to create tooltips for a menu. I want the tooltip to have differend backgrounds for each menu item.
For this I created a UILoader component inside the tooltip mc. When I simply load an external image into the UILoader, everything works just fine. The problems start when I try to load the images on MouseOver. My AS for the MousOver is following:
prch_button.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);
function fl_MouseOverHandler(event:MouseEvent):void
{
tooltip.background_tween.myLoader.load(new URLRequest(“Premium Chardonnay bevell2.png”));
prch_anim.play();
tiptext_container.tiptext_tween.tiptext.text = “Pécsi Chardonnay Premium Selection 2008”;
tooltip.x = mouseX;
tooltip.y = mouseY;
tiptext_container.tiptext_tween.tiptext.autoSize = TextFieldAutoSize.CENTER;
tiptext_container.x = (mouseX) + (tooltip.width * .5) - (tiptext_container.width * .5);
tiptext_container.y = (mouseY) + (tooltip.height * .5) - (tiptext_container.height * .5);
tiptext_container.gotoAndPlay(2);
tooltip.gotoAndPlay(2);
}
When mousing over the mc the whole thing kind of gets stuck (no errors though). I can actually tell that it loads the image, since when I roll over an identically scripted mc (whitout the loader), after mousing over this one, it displays the tooltip correctly.
I tried to create and position the loader in several different ways but nothing seems to work, any help would be greatly appreciated!
Link to my (broken) project: