0
votes

have anyone encountered the issue wherein using a dynamic textfield without embedding fonts causing the flash movie to resize in a very slow manner ( i resize the textfield by using the scaleX and scaleY property, i have also tried using the width and height property but its just the same result)? if i try to set the textfield's embedFonts property to true then there will be no problem when resizing but once i set embedFonts to false then the flash window seems to resize bit by bit

more info: this only happens when textfield text contains many characters (about 100+ chars)

1

1 Answers

0
votes

Try to use FTE (Flash Text Engine), it's much faster than TextField. Here is little performance test.

public class TextFieldVsFteTest extends Sprite {
    [Embed(source="Font.TTF", fontFamily="FontFamilyName", embedAsCFF='false')]
    var _str:String;
    var tl:TextLine = null;         

    public function TextFieldVsFteTest () {    
        var ef:ElementFormat = new ElementFormat();
        var font:FontDescription = new FontDescription();
        font.fontName = "FontFamilyName"
        ef.fontDescription = font;
        ef.fontSize = 12;            
        ef.color = 0x000000;
        var tb:TextBlock = new TextBlock();
        tb.content = new TextElement("<HERE IS YOUR 100+ CHARS>", ef);
        tl = tb.createTextLine(null, 100);          
        addChild(tl);       
        tl.addEventListener(MouseEvent.MOUSE_MOVE, resizeHandler);          
    }

    private function resizeHandler(e:MouseEvent):void {
        tl.scaleX += 0.1;
        tl.scaleY += 0.1;
    }
}

When I had been trying it with TextField it looked very slow (as you said). But with FTE it resizes much faster. You can learn more about FTE here

Hope this helps.