Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Create New TextField with Flash ActionScript 3

This is the second series of Flash ActionScript 3 tutorials. We will also use ActionScript to print out the "Hello World" texts on the stage of Flash movie.

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

In the first serial of Flash tutorial, we used Flash ActionScript printed out the "Hello World" to the Text Field on the stage of flash movie. The Text Field was drawn by us. This would be wonderful if we can also use Flash ActionScript to draw the Text Field as well!

In this tutorial, we are going to use Flash ActionScript to create (draw) a new TextField. And then we will use Flash ActionScript to print out the text "Hello World" to the newly created Text Field.

Flash ActionScript Codes:

///////////////////////////////////////////
///// Create New TextField /////
//////////////////////////////////////////

// Create a textfield object with the name "textField_txt"
var textField_txt:TextField = new TextField();

 

// Add the new textfield_txt instance to the stage
addChild(textField_txt);

 

// Add Content to TextField
textField_txt.text = "Hello World";

Download Flash Source File:

Flash Source File hello-world-again-1.fla

Remarks:

Hey... The Text Field print out on the Top Left corner of the stage. Why? This is because the new Text Field will be created at the Top Left corner (co-ordinate 0,0) by default. In the next tutorial, we will set some properties (e.g. position, size, etc..) to the new Text Field.