Hi!  Use an itemRenderer, extend a lable and add a tooltip data field in your 
arraycollection and point the label.toolTip = data.tooltip;

--- In [email protected], "luketvanderfluit" <lukevanderfl...@...> 
wrote:
>
> Hi.
> 
> Here I have a component.
> 
> Problem is that itemRollOver, itemRollout and change doesnt always close the 
> tooltip. Then Im stuck with an open tooltip that can only be removed by 
> reloading the application...
> 
> I want to use ToolTipManager.hideDelay to automatically hide the tooltip 
> after 2 seconds but
> Putting ToolTipManager.hideDelay = 2000 in an init method doesnt do it...
>  
> Is there any other way I can get the tooltip to die after 2 seconds 
> regardless of what mouse movements take place...?
> 
> Thanks for any help...
> 
> Kr.
> Luke Vanderfluit
> 
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml";
>                 openDuration="250"
>                 closeDuration="250"
>                 selectionDuration="250"
>                 fontSize="8"
>                 prompt="Risk Consequence"
>                 dataProvider="{rcAC}" itemRollOver="toolTipIn(event)"
>                                 itemRollOut="toolTipOut(event)" 
> change="toolTipOut(event)">
> 
>                 <mx:Script>
>                         <![CDATA[
>                                 import mx.core.IToolTip;
>                                 import mx.controls.ToolTip;
>                                 import mx.managers.ToolTipManager;
>                                 import mx.events.ListEvent
>                                
>                                 private var itt:ToolTip;
>                                 private function 
> toolTipIn(evt:ListEvent):void {
>                                         var pnt:Point = 
> evt.currentTarget.localToGlobal(new Point(0,0));
>                                         pnt.y -= 30; pnt.x -= 10;
>                                        
>                                         if (evt.rowIndex == 0) {
>                                                 itt = 
> ToolTip(ToolTipManager.createToolTip(
>                                                         "Insignificant\nNo 
> injury, little or no physical damage, low financial loss.",pnt.x,pnt.y));
>                                         }
>                                         if (evt.rowIndex == 1) {
>                                                 itt = 
> ToolTip(ToolTipManager.createToolTip(
>                             "Minor\nFirst aid treatment controlled on-site 
> with no outside assistance, immediately contained, medium/high financial 
> loss.",pnt.x,pnt.y));
>                                         }
>                                         if (evt.rowIndex == 2) {
>                                                 itt = 
> ToolTip(ToolTipManager.createToolTip(
>                             "Moderate\nMedical Treatment required, controlled 
> on-site with outside assistance, high financial loss.",pnt.x,pnt.y));
>                                         }
>                                         if (evt.rowIndex == 3) {
>                                                 itt = 
> ToolTip(ToolTipManager.createToolTip(
>                             "Major\nDeath and extensive injuries, loss of 
> some capabilities, major financial loss.",pnt.x,pnt.y));
>                                         }
>                                         if (evt.rowIndex == 4) {
>                                                 itt = 
> ToolTip(ToolTipManager.createToolTip(
>                             "Catastrophic\nDeath, loss of majority 
> capabilities, huge financial loss.",pnt.x,pnt.y));
>                                         }
>                                 }
>                                 private function 
> toolTipOut(evt:ListEvent):void {
>                                         if (itt != null) {
>                                                 
> ToolTipManager.destroyToolTip(itt);
>                                         }
>                                 }
>                         ]]>
>                 </mx:Script>
>                 <mx:ArrayCollection id="rcAC">
>             <mx:Object label="Insignificant" data="1"/>
>             <mx:Object label="Minor" data="2"/>
>             <mx:Object label="Moderate" data="3"/>
>             <mx:Object label="Major" data="4"/>
>             <mx:Object label="Catastrophic" data="5"/>
>                 </mx:ArrayCollection>
> 
> </mx:ComboBox>
>


Reply via email to