PDA

View Full Version : htmlText Anchor tags do not support Title attribute for tooltips?



bhjodokast
February 5th, 2010, 04:55 PM
I'm working on a project and I'm encountering an issue with Flash's sporadic support of HTML 1.01 for textboxes that use .htmlText.

The "Title" attribute is not supported for showing tooltips when you hover over the link.

For instance, in an HTML document, a href='index.html' title='Click Here' will show 'Click Here' in a hovering tooltip box. It doesn't display in Flash.

Anyone know of a good work around? I found this page: http://jakruger.blogspot.com/2009/11/flash-cs3actionscript-3-hover-alt-text.html but I have yet to get it working with my text. For instance, I have one textbox, and the URL links are set for various words. This means I don't have the coordinates to set my X and Y for the fake hover effect.

For instance I have a sentence like this one where words are underlined. Is there a way to get those coordinates?

Thanks all

creatify
February 5th, 2010, 05:32 PM
getCharIndexAtPoint (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/TextField.html#getCharIndexAtPoint())
and
getCharBoundaries (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/TextField.html#getCharBoundaries())

use a little math and textField.text.charAt(index); to find the next space, then you have the boundary coords of the entire word/link

bhjodokast
February 5th, 2010, 05:54 PM
Oof.. thank you for the heads up on getCharIndexAtPoint and getCharBoundaries

Adobe is so lazy to not support this, especially considering how much I have spent on their tools over the years; I'm shocked they have no "title" support. :P I'll probably end up populating X-number of boxes and popping the text in there.

bhjodokast
February 9th, 2010, 09:38 AM
Cool, thank you for the update.

I'm now looking for an AS3 class to handle the hover effect.

If i don't find one I'll have to wait until I get to the presentation layer of this Flash project (working with the data right now). Thanks for your responses.

bhjodokast
February 9th, 2010, 11:22 AM
Found a Tool Tip class on this forum:
http://www.kirupa.com/forum/showthread.php?t=265894

Thanks devonair!

Also thanks to creatify for the coordinates that I get using: getCharIndexAtPoint and getCharBoundaries