m_tooltip = ToolTipManager.createToolTip( tooltip, event.stageX + 10, event.stageY + 10 );
I just had an issue where we display a tooltip on a custom component in Flex. This worked fine until we also used this component in a detached window in Adobe AIR. We never saw the tooltip in the detached window.
This is the code we used before in the custom component:
m_tooltip = ToolTipManager.createToolTip( tooltip, event.stageX + 10, event.stageY + 10 );
This is what fixed it:
m_tooltip = ToolTipManager.createToolTip( tooltip, event.stageX + 10, event.stageY + 10, null, this );
The important part is the this
parameter passed into the createToolTip method. If not passed into the method, the framework will always use the FlexGlobals.topLevelApplication
, which is not your detached window. By passing in the reference to custom component to the tooltip manager, it will use the correct native window to display the tooltip in.