Thursday, February 10, 2011

Flash CS4 Textfield weirdness!

I've been working on a flash project where a designer has included a typewriter effect.

The effect was working for the best part of a day, and now with some minor changes to other parts of the fla, it's not working!!

Does anyone have any ideas why this doesn't work....

import flash.text.TextField;

var phrase_string:String="SALE IS ENDING";
var n:Number= phrase_string.length;
var i:Number = 0;

addEventListener(Event.ENTER_FRAME, textCheck);

function textCheck(e:Event):void
{
    if (i < n)
    {
     display_txt.text = phrase_string.substr(0,i+1);
     i++;
     trace(phrase_string.substr(0,i+1));
    }
}

This just runs on the first frame of a movieclip containing the dynamic textfield (with fonts embedded) called display_txt

I'm completely flummoxed!

  • This is a classic font embedding problem. Some fonts treat bold and italic weights differently, and to display these bold or italic versions, you might need to add a new 'Font' (the same font name but different font weight) to export in your library.

    From danjp

0 comments:

Post a Comment