Text Layout Framework Demo
Text is now easy to control in Flash
It can be formatted easily to do Bold, Italic, Underline and Strikethrough
It can also finally do Superscript and Subscript
Links and inline images
are also available
;
_textFlow = TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
// event sent when graphic is done loading
_textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED,graphicStatusChangeEvent);
//To make interactive
//_textFlow.interactionManager = new EditManager(new UndoManager());
//To make selectable
_textFlow.interactionManager = new SelectionManager();
_textFlow.flowComposer.addController(new DisplayObjectContainerController(_container,textArea.width,textArea.height));
_textFlow.flowComposer.updateAllContainers();
}
public function graphicStatusChangeEvent(evt:Event):void
{
// the graphic has loaded (or failed to load) update the display
// actualWidth and actualHeight are computed from the graphic's height
_textFlow.flowComposer.updateAllContainers();
}
public function resizeEvent(evt:Event):void
{
//Resize event - recreate the flowcompser with the correct width and height
_textFlow.flowComposer.removeAllControllers();
_textFlow.flowComposer.addController(new DisplayObjectContainerController(_container,textArea.width,textArea.height));
_textFlow.flowComposer.updateAllContainers();
}
]]>