I am trying to add TextField to a MovieClip using AS 3.0 with following code:
mc = new MovieClip();
mc.graphics.beginFill(0x000000);
mc.graphics.drawRect( 0, 0, 200, 200 );
mc.graphics.endFill();
var t:TextField = new TextField();
t.embedFonts = true;
t.antiAliasType = "advanced";
t.text = "TEST";
var tf:TextFormat = new TextFormat();
tf.color = 0xA5C71B;
tf.size = 30;
tf.font = "Arial";
t.setTextFormat(tf);
mc.addChild( t );
stage.addChild(mc);
But the problem is that MovieClip (black rectangle) is displayed on stage but without the text. Anyone knows what’s the problem?
thanks,
best regards