as3 textField vs label vs textArea
What is the difference between TextField, Label, and TextArea in flash. I'm trying to find the most lightweight class to display text bec开发者_运维知识库ause I will be making lots of them. Any ideas would be helpful. Thanks.
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.)
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
.
精彩评论