Hello Everyone,
I was trying to add a TextField to the stage from an external class. I’ve made a small example of the part that isn’t working for me.
The basic idea of the external class:
package {
import flash.display.Sprite;
import flash.text.TextField;
public class Text extends Sprite {
public function Text():void {
var txt:TextField = new TextField();
txt.x = 0;
txt.y = 0;
txt.text = "this is a text test" ;
addChild( txt );
}
}
}
The timeline code:
import Text;
var a:Text = new Text();
When I run this I don’t get any errors, but the text still doesn’t show on the stage.
Thanks for any help.