5 tips for a better dynamic text management in Flash

I am starting the new year with a post about commons mistakes when using a dynamic text in Flash, and how to manage it

1) Give your text an instance name

Giving your text an instance name will make your dynamic text to be changed more easily than using the Var field.
For instance, if you instanced your text as my_text, you can simply change its content with _root.my_text.text = "Hello World", and you text will be independent from any variable
If you use the Var field, your text depends on the variable you will assign.
It’s not a big difference, but I prefer to change the text no matter any other variable has changed

Flash Fonts

2) Make it Multiline

Even if you don’t plan to have a multiline text, it’s better to have a Multiline text with a single line than a Single line text with multiple lines. To write on a new line, simply use the \n, for example _root.my_text.text = "Hello World\nLine 2".

Flash Fonts

3) Don’t make it selectable

This is a very common mistake… in almost all cases you don’t need selectable text. The problem is Flash sets a dynamic text to be selectable by default.
This is the result… I am showing you the issue on a game of a blog reader but it’s full of these errors in Flash games… mine too…
The game is Wobble Dodge and the error is the one marked in red.

Flash Fonts

There is no need to make the score selectable… isn’t it?

Flash Fonts

4) Think about antialiasing

Talking about antialiasing, there are two types of fonts: pixel fonts and non-pixel fonts. On pixel fonts you don’t have to use antialiasing, while on non-pixel fonts you must use it.

Look at the example for a better understanding

Flash Fonts

So choose wisely when to make a text with or without antialiasing

Flash Fonts

5) Embed the fonts

Ok, you found a really good-looking font and want to use it in your next project… very well… too bad you are the only one to have that font. You must embed the font, or at least the characters you plan to use or in most cases your font will lose antialiasing (that means looking bad) or in some players will be replaced by a default font (that means looking even worse)

Flash Fonts

In most cases embedding Uppercase, Lowercase, Numbers and Punctuation should be enough

Flash Fonts

Ok, that’s all. Let’s make our texts look better

How many times did you mess up fonts?

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 11 comments

  1. wildwobby

    on January 2, 2008 at 4:41 am

    Nice tips!

    I’ll update my Wobble Dodge ASAP.

  2. shiv

    on January 2, 2008 at 9:37 am

    Hi emanuele!
    Great tips..

  3. Wackiedk

    on January 2, 2008 at 10:16 am

    Cool tips, good idea by explaining the common mistakes with dynamic text. Maybe you could also cover up other common mistakes. :)

  4. Jack Hopkins

    on January 2, 2008 at 1:31 pm

    I’ll have to update my games!

    Thanks!

  5. Ed

    on January 2, 2008 at 1:54 pm

    Wow, I never knew most of those things. Definitely the most helpful post in a long time. ^^

    Also how do I get the ‘Character Embedding’ box up? And why is the pic on step 5 the same as on step 1?

  6. Emanuele Feronato

    on January 2, 2008 at 2:08 pm

    Ed: there was an error in the images.
    Check the post again and you will find the right image that will guide you through the character embedding

  7. RJ

    on January 2, 2008 at 3:42 pm

    In my opinion, the most useful tip was the one about making the text selectable, I hate my texts being selectable, but I didn’t know how to avoid it. The 5th tip is also useful

    Thanks, EF

  8. Jensa

    on January 2, 2008 at 7:07 pm

    At Flash On The Beach, I attended a really good session on text and embedding. One of the best tips in the session was to embed two selections in the “Character embedding” dialogue: Basic Latin and Latin 1. If you embed these two, you’re safe for all European languages while embedding as few characters as possible (including scandinavian/german characters such as æ, ø, Ã¥, ö, ü and more).

    The URL for this sessions notes are: http://www.flashmagazine.com/1457.htm and Dave Williamson was the speaker (a little down the page). Includes a surefire Font Embedding method for Flash.

    J

  9. Jamie

    on January 3, 2008 at 10:18 pm

    Hey Emanuele! Thank you so much for these tips! I am self taught in Flash so I am still learning the ropes. Never thought to embed the fonts, though. Built great looking percentage preloaders and, you guessed it, default fonts seemed to show up on all other computers than mine. I fixed it, so again MANY THANKS and your site is already bookmarked!

  10. Text in Flash | Welcome Flash World

    on October 8, 2008 at 6:01 pm

    [...] Read more [...]

  11. Text in Flash | Lemlinh.com

    on October 10, 2008 at 10:16 am

    [...] Read more [...]