Create Text Field With Actionscript 3.0

Text field can be created with ActionScript, the following writing:
   var myText: TextField = new TextField ();
   myText.text = "hello bro";
   addChild (myText);


Then we also can manipulate text fields,

   myText.width = 200;
   myText.height = 40;
   myText.border = true;
   myText.x = 150;
   myText.y = 200;


  In addition, the text display can be enhanced, examples of the script:

   var formatText: TextFormat = new TextFormat ();
   formatText.font = "Arial";
   formatText.size = 24;
   formatText.color = 0xff0000;
   formatText.bold = true;
   myText.defaultTextFormat = formatTeks;


~ Good luck

Share this

Related Posts

Previous
Next Post »