# Form using ASP script

**URL:** <https://forum.kirupa.com/t/form-using-asp-script/13841>\
**Category:** flash\
**Created:** [February 18, 2003, 8:32pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841 "2003-02-18T20:32:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonwill](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dragonwill](https://forum.kirupa.com/u/dragonwill)\
**Post date:** [February 18, 2003, 8:32pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/1 "2003-02-18T20:32:46Z")

</div>

I am using an ASP script to execute my form in flash. The only problem is I need to add a hidden field to make it work. Would I ba able to do that in flash?

This is the code I need to input:

```php

<INPUT TYPE="HIDDEN" NAME="submit_to" VALUE "email@emailaddress.com">

```

Please let me know if this is possible. Thanks.

---

<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 19, 2003, 7:15pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/2 "2003-02-19T19:15:49Z")

</div>

I really don’t fully understand your question, so I’m going to try to answer it as best I can.

Are you populating the values from a ASP page to Flash or the other way around?

If you are sending values to Flash via ASP then try this. In ASP,  
instead of populating a value in a hidden field, which you can still have. assign it to a variable: ie.  
response.write "myemail=myemail@somewhere.com&textbox=ttt"

Then in flash you call your asp page via the LoadVariables function and then just grab the variable names. ie.  
myemail and textbox.

Please clearify your question, thanks.

---

<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 21, 2003, 3:51am UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/3 "2003-02-21T03:51:12Z")

</div>

thank you for responding take a look at my code:

on (release) {  
if (message ne “”) {  
loadVariablesNum(“[http://www.myurl.com/mailscript/addformmail.asp](http://www.myurl.com/mailscript/addformmail.asp)”, 0, “POST”);  
myemail = "my@email.com&textbox=ttt";  
gotoAndPlay(2);  
}  
}

does the “&textbox=ttt” need to be there?

This ASP script works for the html side of my site. I used hidden fields to call my email address. Is this the proper way to call my email address with flash? I can’t get it to work, I used a several different ways. I tried to use “submit\_to” as a variable, that didn’t work either. Please help if you know how. Do you have a sample or anything? Thank 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 21, 2003, 4:55am UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/4 "2003-02-21T04:55:14Z")

</div>

I’m still a little confuse on your asp page. I’ll like to see your asp code.

This how I did part of mine.

loadVariablesNum (“[http://porky/scripts/test2.asp](http://porky/scripts/test2.asp)”, “0”, “POST”);

The code in the test2.asp page has the following

response.write “sFilePath=http://Porky/scripts/”

All I do in flash is assign a variable to my variables in ASP. Then I make sure that the asp page has been executed completely so I can be certain the have the values.

var FilePath= sFilePath; //Coming from the ASP file

Thats it.

Another problem I see in your flash code is this: Remember when you use the loadVariablesNum function to access your variables  
it takes a few seconds to access the variables from your asp page. so if you do a trace on the flash variable following the LoadVariablesNum function you will get a undefined value for your flash movie. Alot of people do is to go to another frame and  
wait for all of the asp values to be executed than assign the  
flash variable to the asp variable. I hope I make sense.

---

<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 21, 2003, 5:33am UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/5 "2003-02-21T05:33:09Z")

</div>

Flash code:  
loadVariablesNum(“[http://www.myurl.com/mailscript/addformmail.asp](http://www.myurl.com/mailscript/addformmail.asp)”, 0, “POST”);

ASP CODE:  
\<%  
Dim strTo, strName, strEmail, strPhone, strMessage  
Dim objCDOMail 'The CDO object

strTo = "email@email.com"  
strName = Request.Form(“name”)  
strEmail = Request.Form(“email”)  
strPhone = Request.Form(“phone”)  
strMessage = Request.Form(“message”)

Set objCDOMail = Server.CreateObject(“CDONTS.NewMail”)

objCDOMail.From = “User”  
objCDOMail.To = strTo  
objCDOMail.Subject = strSubject  
objCDOMail.Body = strBody  
objCDOMail.Send  
Set objCDOMail = Nothing  
%\>

I don’t know what you meant with the secon part. Could you send a sample?

Thanks.

---

<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 21, 2003, 4:12pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/6 "2003-02-21T16:12:34Z")

</div>

Sorry I don’t have a good .fla example. But let me try again.

on (release) {  
if (message ne “”) {  
loadVariablesNum(“[http://www.myurl.com/mailscript/addformmail.asp](http://www.myurl.com/mailscript/addformmail.asp)”, 0, “POST”);  
myemail = "my@email.com&textbox=ttt";  
gotoAndPlay(2);  
}  
}

I assume message is a variable in your asp page to flag if you executed all of your variables in the addformmail.asp page.

Lets also assume your got another variable in the asp page called xyz. ie. response.write “xyz=myemailaddress”

in Flash to access the xyz value, do as follows

on (release) {  
if (message ne “”) {  
loadVariablesNum(“[http://www.myurl.com/mailscript/addformmail.asp](http://www.myurl.com/mailscript/addformmail.asp)”, 0, “POST”);  
var myemail = xyz;  
gotoAndPlay(2);  
}  
}

Thats it, the only other problem you may have is that after the flash loadVariablesNUm function is executed and you do a trace on the myemail variable you may get undefined. Because the asp  
page has not fully. Logically it doen’t make since as a ASP programmer. So to get around it, have a gotoandPlay(frame) to go to another frame and wait until the asp page has been fully executed. Lets see if I can find a good .fla example.

---

<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 21, 2003, 5:28pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/7 "2003-02-21T17:28:02Z")

</div>

I created a sample .fla file which is done a little different then you had it. I’ll send it when I get home tonight. I hope it helps…

---

<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 24, 2003, 8:21pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/8 "2003-02-24T20:21:16Z")

</div>

Sorry for the delay, but here is a sample a little different though.

But you get the idea, just change the url to point to your asp file.

---

<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 24, 2003, 9:21pm UTC](https://forum.kirupa.com/t/form-using-asp-script/13841/9 "2003-02-24T21:21:10Z")

</div>

catch me on MSN: [da\_doctah@hotmail.com](mailto:da_doctah@hotmail.com)

I will help you…
