bjornson’s blog

this blog is very young, come again to watch it grow

Archive for the ‘TextField’ Category

Rotate dynamic system fonts with Flash Player 9

with one comment

Using Flash player 10 lets us use the rotationZ paramter of a TextField. But of course some clients require us actionscript developers to support the older player version as well.

An easy way to get around this problem is to draw the TextField into a Bitmap.  I use my own TextUtils class with a static method like this:

public static function convertTextFieldToBitmap(textField : TextField) : Bitmap

{
    var bitmapData : BitmapData = new BitmapData(textField.width,     textField.height, true, 0x00000000);
    bitmapData.draw(textField);
    var bitmap : Bitmap = new Bitmap(bitmapData);
    bitmap.smoothing = true;
    return bitmap;
}

So rotating and fading the TextField is no problem anymore, also the scaling works much smoother:

This movie requires Flash Player 9

Written by bjornson

March 25th, 2010 at 6:08 pm

Posted in AS3,Flash,TextField