PDA

View Full Version : dynamic textfields do not antialias?


soulmaniac
06-02-2002, 09:30 AM
When I create a dynamic textfield using actionscript it does not antialias. Should I be converting the textfield into a MC?

_root.createTextField("mytext",1,100,100,600,200);

myformat = new TextFormat();
myformat.color = 0xffffff;
myformat.font = "arial";
myformat.size = 100;

mytext.text = "a test text";
mytext.setTextFormat(myformat);

Best regards
Christian Lund

Billy T
06-02-2002, 11:52 AM
if the want antialias text then embed the font.

cheers

soulmaniac
06-02-2002, 02:59 PM
It doesn't seem to do the trick?

I've included the following link to illustrate my point.

flash / php counter (http://www.actionscript.org/tutorials/intermediate/dynamic_counter_php3/index.shtml)

Look closely at the pagecount which is a dynamic textfield and not antialiased.

What to do?

Billy T
06-02-2002, 03:05 PM
do you want your text aliased or antialiased?

dynamic text boxes are aliased by default and use a device font. If you want a custom font you need to embed it and then the dynamic text will become antialiased...

cheers

soulmaniac
06-02-2002, 07:38 PM
Thanx, I finally got it to work using the visual tools in MX. However, when I want to achieve the same result with action script nothing shows up (unless I remove embedFonts=true, and the text will then be visible but aliased).

What am I doing wrong?

_root.createTextField("mytext",1,100,100,600,200);

myformat = new TextFormat();
myformat.color = 0xffffff;
myformat.size = 90;
myformat.font = "Arial";

mytext.text = "actionscript textfield";
mytext.type = "dynamic";
mytext.embedFonts = true;
mytext.setTextFormat(myformat);