Copy link to clipboard
Copied
For example, I want to populate a row of data. I have one frame with input fields and another with the table. How can I connect the text fields so that when I hit submit, their values are sent to the other text fields?
Thanks
1 Correct answer
you don't need a tutorial. you just use the text property of your input textfield to retrieve the text entered by your user and use the text property of your table textfield to display those data:
submit.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:Event):void{
table_tf1.text = input_tf1.text; // where table_tf1 is the textfield where you want to display the text entered in input_tf1.text.
}
Copy link to clipboard
Copied
you can't assign data to your table until it exists. and you can't access data from your textfields after they cease existing.
so, if there's no time/frame when both exist at the same time, store the textfield values in a variable (an array) or variables. when your table exists assign those variable values to your table.
Copy link to clipboard
Copied
Thanks kglad,
If it makes the function easier, I can put the input field and the text field they will populate on the same frame, so the 'exist' at the same time.
That said, how can I send the input value from one field to the other? What kind of function would populate a text box? I'm not sure how to search for this kind of tutorial...
Copy link to clipboard
Copied
you don't need a tutorial. you just use the text property of your input textfield to retrieve the text entered by your user and use the text property of your table textfield to display those data:
submit.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:Event):void{
table_tf1.text = input_tf1.text; // where table_tf1 is the textfield where you want to display the text entered in input_tf1.text.
}
Copy link to clipboard
Copied
That is awesome, can't believe its so simple! The = connects the two...
Fantastic, thanks for your help kglad!
Copy link to clipboard
Copied
you're welcome.
p.s. please mark helpful/correct responses.

