Return to Snippet

Revision: 26578
at May 2, 2010 06:17 by jorisros


Initial Code
//Draw background 
var square:Sprite = new Sprite();
addChild(square);
square.graphics.beginFill(0x0000FF);
square.graphics.drawRect(0,0,250,250);
square.graphics.endFill();



//Draw textarea
var myTextField:TextField = new TextField();  

addChild(myTextField);  

myTextField.text = "some text here!\n Next line";  
myTextField.width = 250;
myTextField.height = 250;
myTextField.border = false;  

var myFormat:TextFormat = new TextFormat();  
myFormat.color = 0xAA0000;   
myTextField.setTextFormat(myFormat);  


//Set the text to the middle
var middle:Number = myTextField.height /2;
myTextField.y = middle - myTextField.textHeight;

Initial URL

                                

Initial Description

                                

Initial Title
Text vertical align

Initial Tags

                                

Initial Language
ActionScript 3