TextField vs Text and Label
Hopefully someone can explain the differences here to me.
I am new to AS, and it's a little frustrating.
I have a sprite and it's being added to a custom UI component
Here is the drawing code within flex:
I have tried adding only one of the 3 children here (just textfield, just label, just text) and running independantly.
var someText = new Text();
var someTextField = new TextField();
var someLabel = new Label();
graphics.lineStyle(1.0, lineColor, 1.0);
var radius:Number = size / 2;
graphics.drawCircle(radius, radius, radius);
someText.text = "Text";
someTextField.text = "TextField";
someLabel.text = "Finally a Label";
The only text that actually DISPLAYS on the sprite is a textfield.
The others don't seem to have been added at all, or at least don't display anything.
The problem is that I don't want any interactivity.
I just want to display text, so I would rather use a Label or a Text rather than a TextField, but for whatever reason this doesn't work for me.
Can anyone let me know how I can get the Label to show up instead, or at least explain to me why there is an incompatibility?
Last edited by sFoster83; 08-04-2008 at 10:25 PM.
Last edited by eggler; 10-14-2009 at 03:08 AM.
I just wanted to use the smallest object possible, since I am going to be creating a ton of these sprites. Label seems to have less weight, so I preferred that over a textfield.
Originally Posted by eggler
i think there are some kind of incompatibility issues for the mx classes and flash classes like you're saying, which seems pretty short sighted on adobe's part. Oh well, I guess I need to get a book discussing in detail the differences between the as3 compiler and the mxml compiler
Click Here to Expand Forum to Full Width
Poll by Flashkit.com