At last, I got around to porting my Tooltip Class to Actionscript 3. Well, when I say “porting”, that’s not quite accurate: this is a complete rewrite. As such, alot of property names in the options have been changed, some of the defaults are different, and there are a few more public methods. So if you’ve been using the old AS2 Tooltip, don’t just copy and paste your code, first have a look at the Class, which is fully documented.
If you’re not familiar with the old AS2 Tooltip: this is a customizable static Singleton Class for generating and displaying Tooltips from anywhere in your code. There are no assests for the library, since the tooltip is created and drawn dynamically, by invoking the static methods:
Tooltip.show(tooltip:String = “”, localOptions:Object = null, target:DisplayObject = null)
Tooltip.hide()
But now there’s another way to invoke the Tooltip: DisplayObject instances can now subscribe and unsubscribe themselves from the tooltip for automatic handling:
Tooltip.subscribe(target:DisplayObject, tooltip:String = “”, options:Object = null)
Continue reading