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

Using htmlText Property in Text Field Flash AS 3 Tutorial

Sometimes you may also require to insert some HTML Tags to Text Field of Flash Movie. This Flash ActionScript tutorial shows how to do it.

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

In previous Flash ActionScript tutorial, you learned how to insert line break and paragraph break in text Field. Now you may also wish to do some styling with the text Field, for example, insert some HTML tags to the Text Field, e.g. <Font>, <B>, <I>, <U>, etc....

The complete Flash Movie is shown as above, you may try how it works before you start this ActionScript tutorial.

Flash ActionScript Codes:

//Set the multiline parameter of the Text Field to true
//The <br> tag creates a line break in the Text Field.
//Must set the text field to be a multiline Text Field to use this tag.
output_txt.multiline = true;


//Allow HTML Property of the TextField
//Apply some HTML tags to texts
output_txt.htmlText = '<font color= "#ff0000">This is the 1st line using Font tag.</font>' + "<br>" +
"<I>This is the 2nd line using Italic tag.</I>" + "<br>" +
"<b>This is the 3rd line using Bold tag.</b>";

Download Flash Source File:

Flash Source File using-htmltext-property-in-textfield.fla


This Flash ActionScript tutorial shows how to insert some HTML tags to the Text Field with htmlText property.