Nothing exciting today as I am getting sidetracked with another web project. Anyways I found this nice little function for creating text fields over at Adobe. I thought I would just add it here to my Actionscript library.
private function createTextField(x:Number, y:Number, width:Number, height:Number,border:Boolean=false):TextField {
var result:TextField = new TextField();
result.x = x;
result.y = y;
result.width = width;
result.height = height;
result.background = false;
result.border = border;
addChild(result);
return result;
}
You can call the function like:
var myTxt:TextField = createTextField(10, 10, 100, 20, false); myTxt.type = TextFieldType.DYNAMIC; // or TextFieldType.INPUT myTxt.text = "Here is some random text";
This will place a 100px (w) x 20px (h) text field at location x=100 and y=20 and will render without a border.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.