Sunday, August 09, 2009
Debugging TLF source code
I was getting the error 1120: Access of undefined property debug. Then I explored the build file(ant script), which is used to build the swc file. There I found two arguments passed to compc:
<define name="CONFIG::release" value="${rel}"/>
Now, what define does ?
compiler.define: define a global AS3 conditional compilation definition, e.g. -define=CONFIG::debugging,true or -define+=CONFIG::debugging,true (to append to existing definitions in flex-config.xml) -->
I added the following arguments in Additional Compiler Arguments to make my Project problems free.-define+=CONFIG::debug,true -define+=CONFIG::release,false
Then it followed with the following errors:
1046: Type was not found or was not a compile-time constant: ContentElement
1046: Type was not found or was not a compile-time constant: GroupElement
1046: Type was not found or was not a compile-time constant: TextBlock
1046: Type was not found or was not a compile-time constant: TextLine
It was obvious, as these all classes are new, so its a Flash Player mismatch in my settings, after changing my flash player version from flash player 9 to flash player 10, all Problems are gone.
Hope this helps someone who is struggling to debug the tlf source code.
Sunday, July 26, 2009
Flash Text got better
TLF is a Text Layout Framework to handle some complex text, selection, editing. It can be used with Flash Professional or Flex. It is framework agnostic as the entire API is in as3 so it can be used with either flex framework or framework which is available in Flash Professional. TLF is a wrapper on top of FTE(Flash Text Engine), which is new in Flash Player 10. TLF renamed many times, it was previously known as Text Layout Foundation/vellum and now Text Layout Framework.
When to use FTE ?
Flash Text Engine deals with Line and Paragraph Layout and TextLine rendering. When you need only static text then its best to make use of FTE.
When to use TLF ?
When you want to deal with Paragraph Layout, Selection, Editing then make use of TLF. TLF has a markup for text, which can be parsed using E4X. Its basically XML.
Where to find TLF Source?
You will have to checkout from SVN, instructions and other details are available at the below location:
http://opensource.adobe.com/wiki/display/tlf/Text+Layout+Framework
How to get started, which classes I should use etc ?
Below are links to some post I found useful to understand TLF:
http://corlan.org/2009/01/19/how-to-use-text-layout-framework-in-flex-32-or-air-15/
http://corlan.org/2009/02/12/how-to-add-a-scrollbar-to-text-layout-framework/
http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html
and I found a nice presentation from one of TLF engineer, Robin Briggs. You can watch it here:
Text Component Library for Flash Player 10
Demo:
http://labs.adobe.com/technologies/textlayout/demos/
Thanks for stopping by, I will be writing few articles on TLF, keep checking or follow on twitter to get updates.
Cheers,
Chetan Sachdev