How can I handle text in AS3 simply?
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 enc开发者_运维知识库ountered 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?
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
.
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.
Check out: F*CSS
精彩评论