package { import flash.display.Sprite; import flash.text.engine.*; [SWF(width="200", height="200")] public class FTEDemo11 extends Sprite { public function FTEDemo11() { super(); var e1:TextElement = new TextElement('"They\'ve just announced a Justin Bieber bio pic being shot in 3D. Wasn\'t that one of the signs of the "end times"?"', new ElementFormat(null, 20)); var e2:TextElement = new TextElement('\n- Rainn Wilson', new ElementFormat(null, 20, 0xCC3300)); var block:TextBlock = new TextBlock(new GroupElement(new [e1, e2], new ElementFormat())); var y:Number = 0; var line:TextLine = block.createTextLine(null, 200); while(line) { addChild(line); y += line.ascent; line.y = y; line.x = (200 - line.width) * 0.5; y += line.descent; line = block.createTextLine(line, 200); } } } }