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?
That'll make it so you can't select the text in AS 3.0... what other interactivity were you worried about?
I'm not sure about mixing in mx classes with Flex.
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.
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