Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Tooltip, drag with the component into which it was placed

I have displayed a tooltip on managerContainer panel with the code:

var p:Point = new Point(m.x+managerContainer.x,m.y+managerContainer.y+m.height);
                        p = this.contentToGlobal(p);
                        var s:String =note;
                        var tip:ToolTip = ToolTipManager.createToolTip(s,
                              p.x , p.y
                              
                        ) as ToolTip;

But my panel is a draggable one. Now I want the tooltip to be dragged when the panel is dragged without destroying and creating the tooltip over and over again. How to do that, do you know?
0
btocakci
Asked:
btocakci
1 Solution
 
deepanjandasCommented:
Try this:
var tip:ToolTip;//declare this outside the function to have a global scope of this variable

var p:Point = new Point(m.x+managerContainer.x,m.y+managerContainer.y+m.height);
p = this.contentToGlobal(p);
var s:String =note;
if( tip == null ){
    tip = ToolTipManager.createToolTip(s, p.x , p.y ) as ToolTip;
}
tip.move( p.x, p.y );

Open in new window


//remember to destroy the tooltip on hide.

Tutorial sample here.
Warm Regards
Deepanjan Das

 
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now