views:

30

answers:

2

What is the difference between TextField, Label, and TextArea in flash. I'm trying to find the most lightweight class to display text because I will be making lots of them. Any ideas would be helpful. Thanks.

+1  A: 

TextField is the lowest level text component provided by the player itself.

Label is a wrapper that introduces the functionality provided by the Flash framework and provides read-only text component.

TextArea is a wrapper that introduces the functionality provided by the Flash framework and provides a read-write text component.

I wouldn't automatically use TextField in an application that is otherwise using the Flash framework just because you're making a lot of them. If Label or TextArea provide functionality that is useful then use those. If not, then stick with TextField.

Sam
Thank you very much that was helpful
+1  A: 

The difference is that TextField is the base display object that Flash uses to display text, while Label and TextArea are UIComponents that support things like skinning and styling. If TextField does everything you need, generally that's what you should probably be using. (And if you're making lots of them, you might consider enabling cacheAsBitmap, to limit how often the text is rendered.)

fenomas
you had me at cacheAsBitmap (which coincidentally happens to be at the end of your answer lol :P)