bjornson’s blog

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

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);
    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

One Response to 'Rotate dynamic system fonts with Flash Player 9'

Subscribe to comments with RSS or TrackBack to 'Rotate dynamic system fonts with Flash Player 9'.

  1. Hi;

    Won’t be easy to use textWidth and textHeight properties, instead of “width” and “height” ?

    Chrysto Panayotov

    21 Apr 11 at 8:41 pm

Leave a Reply