-
-
the naked eye
Hey Humbuged - It has centered it, but the starting point of your dynamic text is cented to the stage. You need to get the width of the text box(297pixels), halve it and minus it from your original centering calculation.code: this.createTextField("dynamic_txt",1,(Stage.width/2),(Stage.height/2),1,1);
dynamic_txt.text = "This is just a test to see if this works.";
var textstyle:TextFormat = new TextFormat();
textstyle.size = 18;
textstyle.font = "Arial";
dynamic_txt.setTextFormat(textstyle);
dynamic_txt.autoSize = true;
trace (dynamic_txt._width)
dynamic_txt._x -= dynamic_txt._width/2
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
|