0
votes

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!

1
What is it not doing now? How exactly is it broken? - Alex Jillard
The textfield wouldn't show any text! I'm not entirely sure still, but I think it's something to do with the font being a bold weight. In the end I just broke the text apart and did it graphically with tweens. Not great because we need to re-use this effect for several different messages. - Ian

1 Answers

0
votes

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.