-
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:
Code:
import flash.text.TextField;
import mx.controls.Label;
import mx.controls.Text;
var someText = new Text();
var someTextField = new TextField();
var someLabel = new Label();
graphics.clear();
graphics.lineStyle(1.0, lineColor, 1.0);
graphics.beginFill(fillColor, 1.0);
var radius:Number = size / 2;
graphics.drawCircle(radius, radius, radius);
someText.text = "Text";
addChild(someText);
someTextField.text = "TextField";
addChild(someTextField);
someLabel.text = "Finally a Label";
addChild(someLabel);
I have tried adding only one of the 3 children here (just textfield, just label, just text) and running independantly.
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?
TextField: http://livedocs.adobe.com/flex/3/lan...TextField.html
Text: http://livedocs.adobe.com/flex/3/lan...rols/Text.html
Label: http://livedocs.adobe.com/flex/3/lan...ols/Label.html
Last edited by sFoster83; 08-04-2008 at 09:25 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|