4 Replies Latest reply on Mar 5, 2012 8:45 AM by Claudiu Ursica

    Make a tooltip scroll with the component?

    foolish3737 Level 1

      I have a series for form items sitting within a scrollable container. When I click on a textinput component it brings up the tooltip. My only problem is, when I scroll the form items the tooltip remains stationary. Is it possible to have the tooltip scroll with the textinput field that it is related to?

       

      Here is a simple demo:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
           <mx:Script>
                <![CDATA[
                     import mx.managers.ToolTipManager;
                     import mx.controls.ToolTip;
                     
                     private var tip:ToolTip;
                     private var message:String;
                     
                     private function showTip(e:Object):void
                     {
                          message = "I have a tooltip!";
                          tip = ToolTipManager.createToolTip(message, e.currentTarget.x + 500, e.currentTarget.y) as ToolTip;
                     }
                     
                     private function removeTip(e:Object):void
                     {
                          ToolTipManager.destroyToolTip(tip);
                     }
                ]]>
           </mx:Script>
           <mx:VBox width="200" height="200">
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
                <mx:TextInput focusIn="showTip(event)" focusOut="removeTip(event)" />
           </mx:VBox>
      </mx:Application>
      
       
      

       

      Thanks!