Forked from: jidolstar's 3D Example, Flash Player 10 : flash on 2009-7-2 diff:369 forked from: 3D Example, Flash Player 10 : flash on 2009-7-2 dotf forked:0favorite:0lines:38license : MIT License modified : 2009-11-12 12:14:25 Embed Tweet package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.text.engine.*; public class TextTest extends Sprite { public function TextTest () { for (var i:int = 0; i <= 20; i++) { var txt:TextField = new TextField(); txt.selectable = false; txt.width = 300; txt.height = 100; txt.text = "Hello world!"; txt.setTextFormat(new TextFormat("Georgia", 2 + 2*i)); txt.x = 6*(i*(i+1)/2); txt.y = 30; txt.rotationZ = 20; addChild(txt); } for (var j:int=0; j<=20; j++) { trace(j); var myString:String = "Hello world!"; var myFormat:ElementFormat = new ElementFormat(); var myFontDesc:FontDescription = new FontDescription("Georgia"); myFormat.fontSize = 2 + 2*j; myFormat.fontDescription = myFontDesc; var textElement:TextElement = new TextElement(myString, myFormat); var textBlock:TextBlock = new TextBlock(); textBlock.content = textElement; var myTextLine:TextLine = textBlock.createTextLine(null, 300); myTextLine.x = 6*(j*(j+1)/2); myTextLine.y = 150; myTextLine.rotation = 20; addChild(myTextLine); } } } } Code Fullscreen Preview Fullscreen FontDescription TextElement ElementFormat TextBlock fontSize content createTextLine textBlock fontDescription rotationZ rotation height width addChild trace TextFormat text String Sprite int