TextFormatting in ActionScript 3 (setTextFormat)

The setTextFormat() method in actionScript 2 used to set the font properties to the text fields.

example:

where in the above coding setTextFormat() method sets color, font type and size to the text field.

But in ActionScript 3 setTextFormat() method is no longer exists to set text formats to the Text Field (both dynamic text field and static text field). So ActionScript 3 we are going to set text formats to the text Fields using TextFormat Class. In this tutorial we are going to use both Text Field Class and TextFormat Class to set font type, font color, position and the font size.

Here is the example code……..

In ActionScript 3 defaultTextFormat sets text format to the text Field.

txt_field.defaultTextFormat=txt_format;

setTextFormat In ActionScript 3

Subscribe to get all tutorial updates, promotional offers and download links for all tutorials via E-Mail

Enter your email address:



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">