[ˈfɔːwədˌθɪŋkɪŋ]

Adobe Flex : Custom ToolTip Implementation Sample

Every sample out there illustrating ho to use custom ToolTips involve calling a method upon registering a ToolTip event… however, that requires you to add toolTip code to every item you want to have showing a custom tooltip.

The preferred way to do it would be to set the ToolTipManager.toolTipClass property to point to your custom tooltip class.
This way an instance of your own class is created in place of the default instance of the ToolTip class.

Doing this requires you to Implement IToolTip and in order to get most of the logic done for you, its preferred that you inherit from UIComponent or one of its inheritants.

In my previous post I have pointed out that there is a bug in the Adobe Flex ToolTipManager implementation, so doing it my way requires you to override commitProperties and set the text property yourself… however, its a small price to pay for getting the power of the ToolTipManager at your disposal instead of having to implement it all by yourself.

I here illustrate a small mock implementation of an application using custom tooltips

First we create a couple of custom toolTip classes, I call the CustomToolTip1 and CustomToolTip2