forked from: 3D Example, Flash Player 10 : flash on 2009-7-2
forked from 3D Example, Flash Player 10 : flash on 2009-7-2 (diff: 369)
ActionScript3 source code
/**
* Copyright dotf ( http://wonderfl.net/user/dotf )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2XW0
*/
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);
}
}
}
}