TLF Samples Now On SourceForge

Our SourceForge site now has code and projects for TLF example applications. These were previously only posted here on the TLF blog, now there will be a samples set for every build. The “sdk” folder contains most of these examples, and they are available as a download.

The sdk folder is divided into two main sections, one for applications that only rely on TLF and the Flash Player, and one for applications that use the Flex Framework for their user interface, but otherwise call into TLF directly. The first group are in the “actionscript” folder, and the second group are in the “flex” folder.

The actionscript folder has these applications:
FTE applications FTEHelloWorld and FTEParagraph. These are very simple applications that create and display simple text content using only the Flash Player (no use of TLF).
Pagination. This application uses TLF to display a book-length text that is divided into chapters, and allows the user to page through the text, advance or backup by chapters, and resize the window.
TextLayout. This is a set of applications that use TLF, each illustrating different aspects of the framework:

  • ContextMenuText shows how to make custom context menus.
  • CustomImportMarkup shows simple import and customization using the Configuration class.
  • CustomLinkEventHandler shows how to customize clicks on links.
  • EditText shows setting up an editable text component.
  • EventMirrorExample shows setting up event handlers on group elements.
  • ExplicitFormField shows how to set up form-field style text that doesn’t wrap lines.
  • HelloWorld shows setting up a read-only text component based on static text.
  • ImportMarkup shows setting up a read-only text component based on markup.
  • InlineGraphic creates a graphic that appears inline with the text, and shows how to handle the asynchronous load process and automatic sizing.
  • LinkedContainers shows how to flow text from one container to another, for when you want a single text stream to appear in a sequence of rectangular areas.
  • LinkEventExample shows how to set up a link to send custom events.
  • MultipleColumns has a text with a headline and body text that appears in multiple columns.
  • ParagraphBorder shows how to draw an ornament around a paragraph, which requires figuring out the area on the stage that is occupied by the paragraph.
  • ParagraphBounds shows how to figure out how much vertical space is required to display a paragraph.
  • SelectText shows how to make a very simple read-only selectable text component.
  • StaticHelloWorld shows how to use the StringTextLineFactory to display some static text in a string. This is more efficient than the HelloWorld example.
  • StaticTextFlow shows how to use the TextFlowTextLineFactory to display a static TextFlow object.

The flex folder has applications that use Flex for the user interface, but call into TLF directly:

  • SimpleEditor is an editable text component with simple buttons for setting the font family, font size, text alignment,indent, line spacing, and similar attributes.
  • SimpleEditorWithCSS is similar to SimpleEditor, but it also allows setting of the styleName and id, and mapping of these with a CSS stylesheet.
  • TextLayoutEditor is a text editor that allows editing of text and almost all attributes you can set in TLF. It uses swcs that are in the other two folders, textLayout_editBar and textLayout_ui.

Building the Sample Code
The code is available as a download, but you can also build it yourself if you prefer. Each folder has a build file in it that you can run from Ant.

So try out these samples, and let us know what you think! If there are additional samples you’d like to see, please let us know what they are.

6 Responses to TLF Samples Now On SourceForge

  1. dada says:


    It would be nice to have some samples showing use of password input text ***** 🙂


  2. Mao Liang says:

    Here is the link for the sample download

  3. Terry Corbet says:

    In the light of the recent changes within Adobe, and with specific respect to the Flex SDK, can you provide a clear Statement of Direction with regards to the flashx.textlayout package. There was a 3.0 release of the .swc on 11/11/11. It includes a demonstration program,, which does not perform proper pagination of even the sample “Alice” source text that it uses.

    A. Where do i submit a bug notice?
    B. Pagination being, more or less, the quintessential test of text layout, it seems to me that this demo ought to be promoted to the regression test suite.

    If the underlying classes and methods cannot be configured to perform perfect pagination in the hands of the designers and developers of the library, it is probably not a Release Candidate by most engineering standards. I don’t believe that the “Alice” test case even comes close to covering the ‘corner conditions’ that would likely be generated by my attempting to adapt the demo to my own enterprise use case with more complex markup. So, I am hopeful that your answers to my questions will provide some basis for attempting to convince the my management team to invest in the technology.

  4. Haykel says:


    under what license are these samples distributed? I’m especially interested in using the ‘textLayout_ui’ library in a commercial application.


  5. jinhuang says:

    Please have a look at license-mpl.htm in