2 Replies Latest reply on Nov 19, 2010 8:57 AM by learner_doug

    Tool Tip?

    flex4 Level 2

      Hi All

       

                      Can any tell me how to use custom component as tool tip? I mean i have a panel that will display some User Information  and i want that panel as ToolTip when i place a cursor on one perticular user..

       

       

      Thanks

      Ram.

        • 1. Re: Tool Tip?
          learner_doug Level 1

          Here is an example that I use for my custom tooltips utilizing toolTip Manager.  I'm certain you can use some kind of inheritance if you have a lot of these since the code is a bit cumbersome. 

           

          import

           

          mx.managers.ToolTipManager;

           

          public

           

          var owms1Tip:ToolTip;

           

          private function createBigTip(event:Event):void

          {

           

           

          var s:String = "1. Order enters COMIT from the CTS Web Center\n\n2. Assigned Staff queries COMIT Tracking for unassigned\n orders and assigns orders to an Order Writer\n\n(CLICK MILESTONE for more options)"

          owms1Tip = ToolTipManager.createToolTip(s, 110, 110,

          null, IUIComponent(event.currentTarget)) as ToolTip;

          owms1Tip.setStyle(

          "backgroundColor",0x0e21a4);

          owms1Tip.setStyle(

          "cornerRadius", 8);

          owms1Tip.setStyle(

          "fontFamily", "Verdana");

          owms1Tip.setStyle(

          "color",0xFFFFFF);

          owms1Tip.setStyle(

          "fontSize",12);

          owms1Tip.width=380;

          owms1Tip.height=128;

          ow1.setStyle(

          "contentBackgroundAlpha", 1);

          ow1.setStyle(

          "contentBackgroundColor", 0xFFFFFF);

          }

           

          private function destroyBigTip():void

          {

          ToolTipManager.destroyToolTip(owms1Tip);

          ow1.setStyle(

           

          "contentBackgroundAlpha", 0);

          }

          1 person found this helpful
          • 2. Re: Tool Tip?
            learner_doug Level 1

            Sorry, I realize this is not a panel.  For a panel you might be able to use the PopUpManager.  Here is one of my example using titleWindow.

             

            In this case I'm using the TitleWindow, so I hope the Panel will also work, but not sure.  The text/links and images and close handler are actually inside my titleWindow.  I presume you could use the mouseOver instead of click.  Hope this was helpful.

             

            // Custom PopUp:ow1 //

             

             

             

            private var popup:ow1PopUp = new ow1PopUp();

            [

            Bindable] public var popUpTitle:String = "EBS New: Order Writer - Queue";

             

            protected function ow1_clickHandler(event:MouseEvent):void

            {

            PopUpManager.addPopUp(popup,

             

            this, true);

            popup.x=110;

            popup.y=110;

            }