1 Reply Latest reply on Jul 18, 2011 1:16 PM by William Spence

    Custom Tooltip - Unable to Control ShowDelay

    William Spence Level 1

      For my application, I have opted to create custom tooltips using the Tooltip Manger and a ToolTip Object like this:

       

       

      import mx.controls.ToolTip;
      import mx.core.IUIComponent;
      import mx.managers.ToolTipManager;
      
      private function createCustomTip(event:Event):void {
           var s:String = "My Custom ToolTip";
           var pt:Point = new Point(event.currentTarget.x, event.currentTarget.y);
           pt = event.currentTarget.parent.localToGlobal(pt);
                          
           customTip = ToolTipManager.createToolTip(s, pt.x + 3, pt.y-event.currentTarget.height-20, "errorTipAbove", IUIComponent(event.currentTarget)) as ToolTip;
           customTip.styleName = "errorTip";
      }
      

       

       

       

      Everything is working beautifuly, the tooltip is showing up in the exact right spot using all the CSS that I want.  But there is 1 big problem, it shows up immediately.  The ToolTipManager has a method called showDelay that allows you to set the delay time for the tooltip to appear.  After reading the documentation, I think that it only works for objects when you use their ToolTip property, but not for custom toolTips.  Please let me know if I am misunderstanding this.  What I can tell you is that adding ToolTipManager.showDelay=1000; to my function does not affect the delay time to show the tooltip at all, it still happens immediately.  The only other thing that I can think to do is set up some kind of timer, but I thought I would ask here first to see if I am just missing something simple.

       

      Thanks.

       

      Message was edited by: William Spence

        • 1. Re: Custom Tooltip - Unable to Control ShowDelay
          William Spence Level 1

          I was able to use a Timer to set when I wanted my custom toolTips to appear fairly easily, but I am still curious if anyone knows, can you only use the toolTipManager to control the showDelay property of objects such as buttons and textInputs that have a toolTip property built in, or can it also be used when you create your own toolTips?  I was not able to get it to work.