Hey, Flash Coders! Happy New Year!

Quick question for you guys: I work a lot with dynamic TextFields that I
design, format and lay out in the Flash CS3 authoring environment. The
problem I frequently run into is that when I go ahead and change the text of
these things in the code, most of the text formatting information is lost.

As a work-around, I've gotten into the habit of calling a function like this
in my constructors...

private function initTextFields():void
{
    for each (var formatMe:TextField in [titleTxt, headerTxt, legalTxt,
storyTxt]) {
        var tf:TextFormat = formatMe.getTextFormat();
        formatMe.defaultTextFormat = tf;
    }
}

This works, but I keep wondering if I'm doing unnecessary work. Is there any
kind of "Keep the current formatting of any textfield I've created in the
authoring environment" checkbox that I'm just missing somewhere?

Thanks!

--Todd
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to