Skip to main content
Known Participant
April 7, 2018
Answered

text box duplications

  • April 7, 2018
  • 23 replies
  • 3588 views

hi i want to have two text inputs and a submit button, and when i press the submit button after entering a number or text or both in the text input field that the other text input field replicates the text box and that the original resets to empty and the data entered is representative in the text field that replicated the text field used when entering information before pressing the submit button.

button is called by instance button, the text input field instance is called enter, and the resultant text field instance is called result1,

secondly i would like the text input field instance called result 1 to be duplicated for every time a number is or character is selected and submitted, and a new text input box to be put underneath text input instance result 1 duplicate called text input instance result 1a, perfectly and to change the information represented in text input instance called result1 but not in instance called result 1a, and those that are perfectly aligned underneath it called instance name : result 1b, result 1c, result 1 d, result 1e, and to follow the pattern nameing them, perhaps not a,b,c,d,e but rather 1,2,3,4,5... and so on.

please can someone help me with a code in AS 2.0, im using adobe 5.5

This topic has been closed for replies.
Correct answer kglad

1.

button.onRelease=function(){

result1.text=enter.text;

enter.text="";

}

2.  i don't understand what all you're trying to do, but you can use the movieclip method createTextField() to create a new textfield using as2.

23 replies

Known Participant
April 7, 2018

yes there is a text input that is set to the text entered when the button is presses, i would like to add a third text input field that also gets the input and does not change when another figure is entered, but instead creates the forth text field input field and stores it as the "second" text input that recieves the entered data and places that box underneath the previous stored figure., and so im hoping to another text field input box created as a second text input box that recieves infomation entered and stored it and is the third stored text input box in a vertical row.

kglad
Community Expert
Community Expert
April 7, 2018

var next_tfY:Number=0;

button.onRelease=function(){

var d:Number=this.getNextHighestDepth();

this.createTextField("tf_",d,enter.x,enter.y+next_tfY+40,150,40);

this['tf_'+d].text = enter.text;

enter.text='';

next_tfY+=40

}

Known Participant
April 8, 2018

HI the code i changed to suit a new button called go1, and used the textinput field size1 which is the resultant text input field from the input text field called size, which is where the text is entered, so i entered text pressed the go button and the text appears in the text input called size 1, heres the code.

go._visible = true;

go.onRelease = function(){

size.text = size1.text;

size1.text="";

}

then i added a resize to a movie clip on the same go button and it works perfect heres the code

go.onPress = function(){

ball1._width = Number(size.text);

ball1._height = Number(size.text);

}

I added the code you gave me and i dont see the new textinput field anywhere on the screen, i used this code

var next_tfY:Number=0;

go1.onRelease=function(){

var d:Number=this.getNextHighestDepth();

this.createTextField("tf_",d,enter.x,enter.y+next_tfY+40,150,40);

this['tf_'+d].text = size1.text;

size1.text='';

next_tfY+=40

}

after pressing go to update the field, i press go1 to store it but the text input field is not where to be see on the screen.

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 7, 2018

1.

button.onRelease=function(){

result1.text=enter.text;

enter.text="";

}

2.  i don't understand what all you're trying to do, but you can use the movieclip method createTextField() to create a new textfield using as2.

Known Participant
April 7, 2018

I tried the above code given by yourself, thank you it works perfectly, the movie clip method create text field() ?

can you give me a coding for the above please.

Ie. button.onRelease = function(){

....

Known Participant
April 7, 2018

can any one comment or reply please