Programming: Flash: Kerning Dynamic Text Fields

>> Thursday, December 13, 2007

Thanks to Random, I whipped up this function that allows you to set the kerning value of any dynamic text field in actionscript.


function kernText(whichField, kerning)
{
    whichField.html = true;
   
    var newFormat:TextFormat = new TextFormat();
    newFormat.letterSpacing = kerning;
    //newFormat.font = "Arial";
   
    whichField.setTextFormat(newFormat);
}


3 comments:

Cody 5:39 PM  

don't know who you are or where you came from but this shit is great!

Winkyboy 7:36 PM  

Hi! Thanks :) I'd forgotten about this post, actually! I've since switched to using Snipplr to post my programming codefun. You can see the rest of my Flash snippets there:

http://snipplr.com/users/Winkyboy/

Aaronius 11:21 AM  

kerning != letter spacing

Post a Comment

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP