When dynamically creating a glossary tool tip on a flash page, the embedded italic text formatting of a TextField which was set in the authoring environment was not showing up at runtime in the flash player.
Apparently there is a bug in the flash player (http://craiggrummitt.blogspot.com/2008/06/kerning-of-dynamic-text-field.html) where the TextFormat information for a TextField is not retained when the text value was changed dynamically using Actionscript.
We have a fla file that contains a pre-configured movie clip that has two textfields: a term name and a term definition. The term name was set to blue, italic text and the term definition was set to black, regular text. The regular font worked fine The italic font was not showing up. The pre-configured movie clip was placed offstage to be used when a glossary term was rolled over.
We got it to work by doing the following:
- Desired Library italic font was created in the fla file and export for actionscript,frame 1 was selected.
- Italic TextField font was set to this new library font in properties tab
- Embedded characters in the properties tab for this TextField
- The GlossaryToolTip class was passed a reference to the TextField
- Constructor saved the initial TextFormat information for the TextField
- toolTipRollOver method resets the authortime format after text changes
1) Italic font created in library
Here is an image of the library font information:
2) Associating Library font to TextField
Here is an image of the TextField selection of the library font:
3) Embedding characters of selected Library in the TextField
5) GlossaryToolTip Constructor code
Code added to constructor(_fmt and _termText are private class variables):
_termText=termText; //save the authortime text formatting _fmt = _termText.getTextFormat();
6) GlossaryToolTip toolTipRollOver method additions
Code added to toolTipRollOver method:
// uses index to set the TextFields to the appropriate glossary text _termText.text=_glossary.getTerm(index); //10-21-09 fix, this resets the authortime format after text change _termText.setTextFormat(_fmt);
Glossary tool tip in action