package { import flash.display.Sprite; import flash.text.engine.*; [SWF(width="200", height="95")] public class FTEDemo12 extends Sprite { public function FTEDemo12() { super(); var e1:TextElement = new TextElement('"They should make a \'baby\' Baby Bjorne for babies to carry other babies."', 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; y += line.descent; line = block.createTextLine(line, 200); } } } }