Skip to main content
Participant
May 25, 2010
Question

Flash CS5, image from library in TLFTextField?

  • May 25, 2010
  • 1 reply
  • 5440 views

I cannot seem to embed an inline image in a TLFTextField from the library.  Using the following snippet (with both a TLFTextField and a standard Dynamic TextField on the stage), the image appears ok in the Dynamic TextField, but no image in the TLFTextField.

var source:String ="image <img src='linkageId' width='100' height='100'/> footer";

TLFText.htmlText = source;

DynamicText.htmlText = source;

Changing the image source to a file path, and the image appears correctly in both.  However, I would really like to keep using the in-library symbols if possible, and the TLFTextField documentation suggests this is still possible.

This is using Flash Professional CS5 11.0.0.485 on Windows 7.  Any suggestions would be appreciated.

This topic has been closed for replies.

1 reply

Adobe Employee
May 25, 2010

I'm not sure I have a good answer to this, but I can tell you what I know, and maybe that will help get you further. Feel free to ping back with more questions.

First, the markup for images in the HTML markup is not supported, because TLF doesn't have support for floats, only for inline graphics. But there is support for <img> in the TLF markup. You can see this in FLA file, which is a zipped XML file. If you unzip the file, and you've added TLF text, you'll see a TLF TextFlow. Inside the TextFlow, you can put an <img> element (see the TLF Blog for a TLF markup description). The <img> element can have a "source" and a "customSource" attribute. These get set to a number, which maps to an entry in the <elements> element, which is a child of the DOMTLFText element. The number in the customSource in the  img element maps to the a DOMSymbolInstance in the elements. That, in turn, has a libraryItemName, which is the name of the XML file that contains the inline. In my case, I'm using a file generated by InDesign, its called "InlineText". Inside the InlineText.xml file is a DOMBitmapInstance with a libraryItemName that contains the name of the JPG file the inline is linked to.

Whew. I'm not saying there's not an easier way to do this, but this is how its all expressed in the FLA file. I'm guessing there's a parallel mechanism inside Flash runtime, but I don't know what it is -- I will see if I can get someone who knows Flash to answer, or you could try posting to a Flash Pro forum. In the meantime, I'm hoping this helped.

- robin

Adobe Employee
May 25, 2010

Flash Pro sets up the inlineGraphicImageResolver to figure out the symbols.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/Configuration.html?allClasses=1#inlineGraphicResolverFunction

Somehow that's not getting called or properly resolving the symbol.

Richard

grantcoxAuthor
Participant
May 26, 2010

Thanks for the insight guys.  At this stage I might just sit with "it's broken" and wait for a point release - hacking around a replacement inlineGraphicResolverFunction sounds like it'll burn too much time and likely not fix anything.