Not saying much, but: no normal workaround that I know. This is behavior
that has been in Flash since the AS2 days - certain properties (like
letterSpacing) are always lost with defaultTextFormat so you always need to
set it again. I always used something similar to your code.

Zeh

On Mon, Jan 4, 2010 at 3:21 PM, Todd Kerpelman <t...@kerp.net> wrote:

> 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
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to