PDA

View Full Version : Why am I losing my Text Format????



tylerdudley1986
October 12th, 2007, 03:08 PM
Ok, so I'm not in any kind of real AS trouble, but I'm miffed.

I have a TextField. I have set 'letterSpacing' for my text field because I think the letters are too far apart. Then when I want to manipulate the text in my TextField, I do this:

TextField.text = "my new text"

...But when I do this I lose my nicely spaced effect, and the text goes back to how it was - all far apart!!

So I have to set the letterSpacing using a TextFormat object EVERY time I reset the TextField.text. Now why on earth would this be? Does anyone have the same thing, or am I doing it wrong? eek!

anyway, if anyone could either ***** about this or shed some light on it I'd be very greatful.

Thanks,

Tyler

orangehaze
October 12th, 2007, 03:22 PM
Hope this helps. (Adobe Live Docs for AS3 setTextFormat())

"Any text inserted manually by the user, or replaced by means of the replaceSelectedText() method, receives the text field's default formatting for new text, and not the formatting specified for the text insertion point. To set a text field's default formatting for new text, use defaultTextFormat."

tylerdudley1986
October 12th, 2007, 03:29 PM
Woohoo I knew there had to be something. Thanks! A