views:

74

answers:

3

I feel like every time I need to use TextField or anything else related in AS3, it becomes a giant mess of code just for a few lines.

I have tried using css as well for text but have encountered some issues where it isn't rendered the same on different servers/clients.

Are there any text handling libraries that I don't know of or some other way to manage text in AS3?

+1  A: 

You could create custom GUI components to encapsulate the giant mess of code and then provide a simple interface for doing what you want. You could either extend TextField, or, favoring composition over inheritance, your custom class could contain a TextField.

Shakedown
That what I was going to do if I found no other solution. Thanks though :)
Ólafur Waage
This is what I ended up doing in a project that had many dynamically created GUI widgets. A simple EasyTextField class that managed its own TextFormat and had a constructor with many default arguments in order of decreasing priority did wonders for my code's tidiness.
aib
A: 

To be totally honest Flash doesn't support fonts very well, actually it's appalling. So I save myself a lot of time and just use the Flash IDE to create a textfield, embed the fonts, enclose it within a MovieClip that's then classed up and export it as a SWC and link it into my compiler as a library. Simples.

Ahmed Nuaman
A: 

Check out: F*CSS

connatser
Also, TinyTLF from Paul Taylor: http://github.com/guyinthechair/tinytlf
connatser