TLF supports a new property on TextFlow called formatResolver of type IFormatResolver. Clients can supply an implementation that can be used to do CSS or “based-on” styling (ala traditional word processors).
Flex Gumbo beginning with revision 4946 now contains TLF Build 370. This build contains many API changes and enhancements. This blog entry is the first of several detailing the changes.
Note that all these changes are tentative pending further review.
The changes described in this entry are:
- Merging of Format Classes
- Changes to Styling
- Class FlowElement’s TExtLayoutFormat APIs
- User Styles
- Non-Inhering Styles
- FlowElement id and styleName properties
- API Changes
NOTE: Updated to TLF Build 460. http://blogs.adobe.com/tlf/Pagination460.zip
The Pagination example in the TextLayoutFramework is posted to build with Adobe Flash CS4 Professional and the TextLayout plugin. Its also possible to build this example with Flex as an ActionScript only project. It does require the Flex 3.2 or Flex gumbo SDK.
I’ve posted the actionscript version that builds with Flexbuilder here: Download file
This version doesn’t have the buttons the Flash Pro version has. Use page up/page down to switch between chapters and the arrow keys to move between pages.
Both the ActionScript version and the Flash Pro version use PaginationWidget.as to manage the paginated view. This is example code that you can use to build your own paginated view. The pagination widget adds new containers until all the text is in a container and then displays some number of containers emulating columns. It supports resizing the visible area. One of the goals was to avoid recomposing every time the visible area changed by a small amount. Hence the decision to relayout during resize has some heuristics.
Note that the labs release has bugs (since fixed) in displaying selections when some of the containers are not visible. This example doesn’t make use of an interactionManager due to those bugs.