Friday, October 9, 2009

Kern dynamic text is Flash Actionscript

I've always needed to know how to kern dynamic text is Flash Actionscript, and I knew there had to be a way. Well, here it is. I discovered this somewhere, made some tweeks, good stuff.

function kernText(myTextField, kerning) {
myTextField.html = true;
var newFormat:TextFormat = new TextFormat();
newFormat.letterSpacing = kerning;
//newFormat.font = "Arial"; // Add now whatever format needs you have.
myTextField.setTextFormat(newFormat);
}

3 comments:

Aaronius said...

That's not kerning, that's letter spacing.

SaidK said...

Kerning – Adjusting the space between characters.

It is the same as letter spacing.

Matt said...

Aaronius - Look it up. :-) http://dictionary.reference.com/browse/kerning ... and you're welcome.