Search code examples
apache-flextooltiptlf

In Flex 4.5, how to add a toolTip to an InlineGraphicElement inside a TextFlow (TLF) using ActionScript (not MXML)?


var newParagraph : ParagraphElement = new ParagraphElement();

var icon : InlineGraphicElement = MY_ICON;
//   icon.toolTip = "boo"  ????
newParagraph.addChild( icon );

I want a specific toolTip for "icon". I have read about using HTML and rollOver and rollOut (e.g. Thanks, Mister), but I'm building this as part of a larger text block; it's difficult to switch from incremental objects to HTML in the middle.

If I cannot set an event on the icon, can I create an HTML bit in ActionScript as part (but not all) of a paragraph ?

Cheers


Solution

  • I just came across the same problem.

    The easiest solution i found was wrapping my InlineGraphicElement in a LinkElement.

    The LinkElement already dispatches mouse events.