TextArea Masking

You can mask the TextArea component if you set the Cache as Bitmap option. Select the TextArea on the stage and find the option labeled as: use runtime bitmap caching, in the Property Inspector.

Selecting this option allows the TextArea to be masked. However it doesn’t seem to allow you to set the alpha. Still looking for an answer to that…

TextArea and Embbeded Fonts

The subject of embedding fonts in the TextArea Component came up yesterday. I didn’t know the answer. But, after some research I found the following works with regular text.

Create a TextArea on the stage. Add some text to the text property in the Component Inspector.

Give the TextArea the Instance name: a_txt.

Create a new Font in the Library, by clicking the little button in the upper right of the library. Choose New Font. Choose the Font and size. Click OK. Find the find in the Library, right click, choose: Linkage. In the Linkage box select Export for ActionScript. Note the Class name. In my example it was Font1.

Add the following on a frame or in class that can access the text Area.

var font:Font = new Font1() as Font;
var tf:TextFormat = new TextFormat();
tf.font = font.fontName;

a_txt.textField.embedFonts = true;
a_txt.setStyle( “textFormat”, tf );

SimpleScrollText

Here’s a class that creates a Scrollbar and TextField, that requires no AS at all. The example inlcudes all of the Classes in a package. The classes include, SimpleScrollBar, SimpleScrollText and ScrollBarEvent.

These classes look for MovieClips with the names up_mc, down_mc, drag_mc, track_mc and scroll_txt. You can leave up_mc and down_mc if you do not want these buttons. Or use only the buttons and leave out drag_mc and track_mc.

Assign the SimpleScrollText or SimpleScrollBar class to the Base Class of the MovieClip that contains the Scrollbar elements.

simplescrolltext