Chances are you'll have to gain information from users of your application for one reason or another whether it is a contact form or an interactive game. This means you'll have to create a form of some sort, in this tutorial we'll go through the process of creating dynamic text fields inside Actionscript.
We first create a new TextField object that'll give us access to all the properties, methods and events of the TextFields class. We'll call this TextField object textInput.
textInput.type = TextFieldType.INPUT;
textInput.border = true;
textInput.height = 20;
textInput.x = 100;
textInput.y = 100;
addChild(textInput);
We want to make sure that the user can input data into the text field, to do this we simply set the type property to INPUT. INPUT is a property of the TextFieldType class.
textInput.type = TextFieldType.INPUT;
textInput.border = true;
textInput.height = 20;
textInput.x = 100;
textInput.y = 100;
addChild(textInput);
Setting the border property to true gives the text field an outline.
textInput.type = TextFieldType.INPUT;
textInput.border = true;
textInput.height = 20;
textInput.x = 100;
textInput.y = 100;
addChild(textInput);
We set the height property to 20px and change the position of the text field on the stage to 100px. Finally using the addChild() method we add the text field to the display list.
textInput.type = TextFieldType.INPUT;
textInput.border = true;
textInput.height = 20;
textInput.x = 100;
textInput.y = 100;
addChild(textInput);
This post is tagged Actionscript 3, Add new tag, AS3 Guide, Dynamic Input Fields
Share This Post
Jobs


























One Comment
nice easy tutorial
Incoming Links
Leave a Reply