FORUMS: list search recent posts

Flash and Text formatting

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aaron Babcock
Flash and Text formatting
on Nov 13, 2011 at 1:35:30 am


I have a dynamic TextField with very wide letter spacing in my .fla. However, whenever I change the text in the TextField using actionscript, the letter spacing resets. Is there a way to keep that from happening? And why does it happen in the first place? Thank you so much for all your help,


P.S. If it's any help, I'm using Flash CS4.

Return to posts index

demetri tashie
Re: Flash and Text formatting
on Nov 19, 2011 at 3:30:59 pm


this all has to do with TextFormat

a lot of the properties of TextField, like color and size, font, width, height, etc will 'stick' to your dynamically changed text.

other properties like letterSpacing won't, as you found out, and are best declared using TextFormat.

for a dynamic text field on the stage with the instance name of 'text1', and a desired spacing og '56'
you can declare it like this:
var newTextFormat:TextFormat = new TextFormat();
newTextFormat.letterSpacing = 56;
text1.defaultTextFormat = newTextFormat;

which will assign ( and hold) that format through all your dynamic changes.

i hope that helps

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved