var txtIt:Text = new Text();
txtIt.text = full_array[t][0];
txtIt.width = 700;
txtIt.buttonMode = true;
txtIt.mouseChildren = false;
txtIt.selectable = false;
txtIt.y = t * 30;
trace(txtIt.textWidth);
myCanvas.addChild(txtIt);
Why can't i get the textWidth for the component? I can get it for textFields.
I've used the namespace code and i have this:
import mx.core.mx_internal;
use namespace mx_internal;
var txtIt:Text = new Text();
txtIt.text = full_array[t][0];
txtIt.width = 700;
txtIt.buttonMode = true;
txtIt.mouseChildren = false;
txtIt.selectable = false;
txtIt.y = t * 30;
var txtfld:TextField = txtIt.getTextField() as TextField;
trace(txtfld.textWidth);
myCanvas.addChild(txtIt);
But I get TypeError: Error #1009: Cannot access a property or method of a null object reference.