# ASP Form from Flash

**URL:** <https://forum.kirupa.com/t/asp-form-from-flash/38609>\
**Category:** programming\
**Created:** [December 26, 2003, 9:18pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609 "2003-12-26T21:18:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wish7](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wish7](https://forum.kirupa.com/u/wish7)\
**Post date:** [December 26, 2003, 9:18pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/1 "2003-12-26T21:18:08Z")

</div>

Hi everyone…I hope everybody had an excellent Christmas!!! I loved the time spent with my family!!!

Anyways, I created a form in Flash to put information into a database. It works fine except for the processing page pops up everytime I submit. What do I do to stop this?

---

<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:** [December 26, 2003, 9:44pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/2 "2003-12-26T21:44:46Z")

</div>

Post your Flash code, and we might be able to 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:** [December 26, 2003, 9:49pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/3 "2003-12-26T21:49:08Z")

</div>

use sendAndLoad instead of just send. I had the same problem.  
just use the process page to report back wether or not the info was entered correctly.

---

<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:** [December 26, 2003, 11:55pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/4 "2003-12-26T23:55:59Z")

</div>

Here is the code in the flash doc:

function onClick(btn) {  
if (btn == submit\_btn) {  
getURL("…/processForm.asp", 0, “POST”);  
gotoAndStop(“thanx”);  
} else if (btn == reset\_btn) {  
fName = “”;  
lName = “”;  
email = “”;  
comments = “”;  
}  
}

---

<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:** [December 27, 2003, 12:49am UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/5 "2003-12-27T00:49:15Z")

</div>

```auto

sendVars = new LoadVars();
getVars = new LoadVars();
getVars.onLoad = function(success){
	if(success){
		if(this.entered == "true"){
			gotoAndStop("thanx");
		}else{
			trace("Data Entered Succesfully");
		}
	}else{
		trace("ASP Error");
	}
}
submit_btn.onRelease = function() {
	sendVars.fName = fName;
	sendVars.lName = lName;
	sendVars.email = email;
	sendVars.comments = comments;
	sendVar.sendAndLoad("../processForm.asp", getVars, "POST");
};
reset_btn.onRelease = function(){
	fName = "";
	lName = "";
	email = "";
	commments = "";
}

```

make sure your asp page returns a value for entered of true if the data was entered correctly and false if not.

edit: please use ’

```auto
' tags around your actionscript when posting, it makes it easier to read for us :beam:
```

---

<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:** [December 29, 2003, 6:03pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/6 "2003-12-29T18:03:37Z")

</div>

Thanx norie, but whne I entered that code nothing happened. Am I supposed to change anything? I have been looking at it in an attempt to understand. I am pretty new at the actionscript. What exactly is this code saying and doing?

I really prefer the:

actionscript:

submit\_btn.onRelease = function() {  
sendVars.fName = fName;  
sendVars.lName = lName;  
sendVars.email = email;  
sendVars.comments = comments;  
sendVar.sendAndLoad("…/processForm.asp", getVars, “POST”);  
};  
reset\_btn.onRelease = function(){  
fName = “”;  
lName = “”;  
email = “”;  
commments = “”;

It gives me a better understanding of how things work. Thank you so much for the 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:** [December 29, 2003, 10:27pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/7 "2003-12-29T22:27:31Z")

</div>

[http://www.kirupa.com/developer/actionscript/forms\_database.htm](http://www.kirupa.com/developer/actionscript/forms_database.htm)

---

<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:** [December 29, 2003, 10:44pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/8 "2003-12-29T22:44:53Z")

</div>

I already looked at that tut, but it doesn’t tell you how to keep the window from popping up!

---

<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:** [December 31, 2003, 6:54am UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/9 "2003-12-31T06:54:34Z")

</div>

> \*Originally posted by wish7 \*  
> \*\*I already looked at that tut, but it doesn’t tell you how to keep the window from popping up! \*\*

ahh but yes it does my friend, your using getURL. the tut states you should use loadvariableNum

```auto

loadVariableNum("../processForm.asp", 0, "POST"); 

```

---

<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:** [December 31, 2003, 7:54pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/10 "2003-12-31T19:54:56Z")

</div>

I stand corrected! Thanx!

---

<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:** [December 31, 2003, 8:27pm UTC](https://forum.kirupa.com/t/asp-form-from-flash/38609/11 "2003-12-31T20:27:17Z")

</div>

No problem, i didn’t know what you meant at first or I would have just said this from the beginning. 🙂

Happy New Year!!!
