I’ll be releasing more tools and helpers in the near future as I formalize / clean-up my existing code libraries. In addition to the ActionScript pagination system released earlier this month, PaginatorAS3, today I’m release a small Tooltip system.
Hover over a icon to see it’s tooltip:
This small library makes adding tooltips to ActionScript based projects really easy. Some key features are:
- Instance based, not Singleton (as it is in Flex) which allows for multiple instances to exist in a single application.
- Objects who have tooltips do not need to know about the display controller
- Easily add a tool tip to any custom DisplayObject
To add tooltips to an application you need to create an instance of ToolTipController. ToolTipController has two parameters, the first is the root DisplayObjectContainer that you want to find tooltips in, (It will automatically find any tooltip’s in it’s display list), and the second is an instance of the IToolTip interface which will handle the tool tip target.
var toolTip = new ToolTip(); new ToolTipController(stage, toolTip);
The ToolTipController will look for any objects that implement the IToolTipTarget interface.