Search code examples
actionscript-3flashflash-cs6tlf

Using images from library with TLFTextField


I can use inline images with TLFTextField referring to an URL. But I need to fetch it from library because it causing blinks every time when same image loaded. I tried to convert an image to MovieClip and load it like I could do it with TextField but no luck.

To be more specific I'm writing a chat application with icons but I couldn't find a decent solution about smilies.


Solution

  • Have you considered using html inside your TLF, you could then utilise library item identifiers as the src or the img tags.

    <img src="myLibraryImage" width="100" height ="50"/>
    

    update: the below link documents someone experimenting with this a few years back where they:

    • create TLF
    • add a new TextFlow element
    • add a new paragraph element
    • add an InlineGraphicElement with the source as a class instantiation

    previous thread

    the InlineGraphicElement is documented here: InlineGraphicElement