How do I underline text in Flash MX?

You’d think for how beloved of a program Flash is, you would be able to do something as simple as underline text. But no, it is something really complicated.

In order to underline text:

New Document in Flash.

Choose your text tool and draw a rectangle

In your properties inspector, select dynamic and give the text field a name “copy”.

Then, open the actions inspector

Type these lines of code

Copy.htmlText = “This is some random copy”
Strike = new TextFormat();
strike.underline = true;
strike.size = 12;
strike.font = “Arial”;
copy.setTextFormat(14, 20, strike);

There are other ways of doing this, using Flash’s capabilities to recognize basic HTMl in text fields, but this defines a style, sets the values and then sets the characters that should have the style applied to the text box.

Here are some similar arcade posts
Print This Post Print This Post

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)