I’ve created something that works like a ToolTip in my Flex application. When I roll over a certain item renderer, I pop up a new control, position it, and remove it on roll out. The order of operations is like this:
- Roll over event handler triggered.
- Add the tooltip to this.systemManager.topLevelSystemManager.toolTipChildren.
- On creation complete of my tooltip, set x, set y coordinates of the tooltip (on creation complete so the width and height are calculated since they are dynamic).
- Roll out event handler triggered.
- Remove tooltip.
This worked fine when I set the x and y coordinates to be x+10, y+10 from the current mouse position. I wanted to add something that re-positioned the tool-tip if it was going to be drawn partially off screen. I added a step that would calculate if it would be drawn off screen, and re-position the tooltip if it was going to be cut off.
The problem with my solution seems to be that it now runs in an infinite loop of redraws, since adding the tool-tip to the screen underneath the mouse triggers the “rollOut” on the item renderer. This triggers the removal of the tooltip, and starts the process over again from 1.
So I guess my question is: is there any way to ignore tooltip so it doesn’t take the mouse focus away from the item renderer that is now under it? Or are there any other good solutions? Thanks in advance.
Probably should have searched a bit more before posting this question. For anyone else looking, I just needed to set
mouseEnabled=falseandmouseChildren=falseoptions on my tooltip.