The Text Layout Framework is an extensible library, built on the new text engine in Adobe Flash Player 10, which delivers advanced, easy-to-integrate typographic and text layout features for rich, sophisticated and innovative typography on the web. Some benefits provided by this framework include: 1) rich typographical controls, including kerning, ligatures, typographic case, digit case, digit width and discretionary hyphens 2) cut, copy, paste, undo and standard keyboard and mouse gestures for editing 3) selection, editing and flowing text across multiple columns and linked containers 4) bidirectional text, vertical text and over 30 writing scripts including Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Lao, Vietnamese, and others 5) vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier for East Asian typography. Try editing this text and playing with the options below! Notice an inline image is also included.

; private var _textFlow:TextFlow; private function init():void { _textContainer = new SpriteVisualElement(); canvas.addElement(_textContainer); var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT); importer.throwOnError = true; // will throw exception if parsing error occurs on import _textFlow = importer.importToFlow(textInput); _textFlow.flowComposer.addController(new ContainerController(_textContainer, canvas.width-40, canvas.height)); // add the graphic var p:ParagraphElement = new ParagraphElement(); var inlineGraphicElement:InlineGraphicElement = new InlineGraphicElement(); inlineGraphicElement.source = imgClass; inlineGraphicElement.width=32; inlineGraphicElement.height=32; p.addChild(inlineGraphicElement); _textFlow.addChild(p); //adding Select/Edit/Copy/Paste/Undo features _textFlow.interactionManager = new EditManager(new UndoManager()); // initialize with a selection before the first character _textFlow.interactionManager.selectRange(0,0); _textFlow.flowComposer.updateAllControllers(); } private function changeFontSize(event:Event):void { _textFlow.fontSize = fontSize.value; _textFlow.direction = direction.selectedItem.data; _textFlow.flowComposer.updateAllControllers(); } private function changeNoColumns(event:Event):void { var tlf:TextLayoutFormat = new TextLayoutFormat(); tlf.columnCount = cols.value; tlf.columnGap = 15; tlf.direction = direction.selectedItem.data; _textFlow.format = tlf; _textFlow.flowComposer.updateAllControllers(); } private function changeTextDirection(event:Event):void { _textFlow.direction = (event.target as DropDownList).selectedItem.data; _textFlow.flowComposer.updateAllControllers(); } protected function undo_clickHandler(event:MouseEvent):void { var em:EditManager = _textFlow.interactionManager as EditManager; trace("Can undo " + em.undoManager.canUndo() + " can redo " + em.undoManager.canRedo()); em.undoManager.undo(); } protected function redo_clickHandler(event:MouseEvent):void { var em:EditManager = _textFlow.interactionManager as EditManager; em.undoManager.redo(); } ]]>