Animating static text in Actionscript 3

So I ran into a little problem today and I thought I’d share it with you guys. I created a button that had a static text field inside of it, then I tried to simply fade the button in and out. This worked fine in my test files; however when I tried to put the same code into my actual application, the fades all failed to work. After beating my head against a wall for a few hours (note to self, get foam padding for walls at office), I finally came upon the source of my problem: a font that I had embedded into my library. I have been forced to embed fonts in my library at publish time (go to your library, then click on the options drop-down in the upper-right and select New Font) due to an error with Flash CS3 / Actionscript 3 not actually allowing you to embed fonts via actionscript (as is stated in all current documentation). So what is happening is this: by embedding the font in my library, it is somehow not allowing any static text fields that use that same font-family to be animated in any way (including fades). My only options were to either delete the embedded font from my library (which resulted in all of my dynamically created text fields that use that font breaking), or to simply use a different font-family for the static text fields. I chose the latter (Tahoma is pretty close to verdana, and at a 10 point font size, you barely notice) as it worked well in my situation. Hopefully this will be fixed with future release/updates to flash, but for now those are the only options I’ve found.. Off to find some advil …


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button


2 Responses to “Animating static text in Actionscript 3”

  1. San Diego Flash Users Group animating text in actionscript 3.0! SDFUG Adobe flash flex air actionscript RIA

  2. I just wanted to say thanks for the post. I just stumbled into that problem today and wasn’t really sure what to do about it. All is well in my little flash world now.

Leave a Reply