# Passing Data from Input Field to Dynamic Text Box

**URL:** <https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830>\
**Category:** Uncategorized\
**Created:** [February 2, 2004, 11:06am UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830 "2004-02-02T11:06:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobbie78](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@jobbie78](https://forum.kirupa.com/u/jobbie78)\
**Post date:** [February 2, 2004, 11:06am UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/1 "2004-02-02T11:06:21Z")

</div>

Sorry guys if someone has covered this but I couldn’t find the answer in past threads.

Basically I just need information that is entered by the user into a input field to be passed to a dynamic text box.

Ie on a contact form when they submit their request a message is displayed saying "Thankyou{users name}, your request has been recieved.

The rest of the form is working, it’s just this bit!!!

Any info would be gratefully received.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 1:39am UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/2 "2004-02-04T01:39:16Z")

</div>

I tried it…But I can’t get it to work,

What Code am I missing on Fame 2?

When I press the not working button and it goed to fame 2 …“Thank you UNDEFINED”

Thanks

Can’t upload the fla. Here is the code in Fame 1:  
myButton.onRelease = function () {  
var myusername\_var1 = myUsername.text;  
myResult2.text = myusername\_var1;  
gotoAndplay(2);  
}

Here is the code in Fame 2:

myResult2.text ="Thank you "+ myusername\_var1;  
stop();

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 1:59am UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/3 "2004-02-04T01:59:06Z")

</div>

Got it…I think

Is this correct?

I changed the following

Fame 1:  
myButton.onRelease = function () {  
**\_global**.myusername\_var1 = myUsername.text;  
myResult2.text = myusername\_var1;  
gotoAndplay(2);  
}

Here is the code in Fame 2:

myResult2.text ="Thank you "+ **\_global**.myusername\_var1;  
stop();

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 9:49am UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/4 "2004-02-04T09:49:09Z")

</div>

Noticed last night it would work if I removed the gotoAndStop(2);  
I had tried using \_global but still no joy.

I notice in your code you have gotoAndPlay(2)… why would that make a difference?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 3:34pm UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/5 "2004-02-04T15:34:59Z")

</div>

:hangover: I don’t know. Sorry I can’t answer that. I was trying different things and I guess I left GOTOANDPLAY instead of the original gotoandstop.

Did the fla I loaded work for you?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 3:49pm UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/6 "2004-02-04T15:49:22Z")

</div>

Ok, you call the function in frameX, define the dynamicText there with “thanks + username”; then go to frame Y to display.  
This can’t work, as when you set the dynamic textfields text, it does not exist yet for flash, as it only appears on hte following frame; so your text gets lost!  
that’s why it (should) work(s) with \_global, the \_global var will still be available, but you’ll still have to script dynaTxtfield.text on the frame it appears…  
hope this explanation is not too messy… 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 4:00pm UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/7 "2004-02-04T16:00:16Z")

</div>

hey,

that’s makes sense but I did try that last night and no joy. also if I added a trace and removed the gotoAndStop(2) line the variables contents would appear in the output window, if I added the gotoAndStop(2) line back in the trace would come back with nadda, nothing… why?

if I have no joy tonight I’ll post code on here later…

thanks for everyones help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 4, 2004, 4:08pm UTC](https://forum.kirupa.com/t/passing-data-from-input-field-to-dynamic-text-box/41830/8 "2004-02-04T16:08:55Z")

</div>

because, as i just explained, on frame 2, the var is not defined anymore… 🙂  
[AS] myBtn.onRelease = function() {  
\_global.username = input\_field.text;  
gotoAndStop(2);  
}  
[/AS]  
frame2: textfield.text = \_global.username;
