# Forms in a Movie Clip

**URL:** <https://forum.kirupa.com/t/forms-in-a-movie-clip/26760>\
**Category:** Uncategorized\
**Created:** [July 26, 2003, 1:07am UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760 "2003-07-26T01:07:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranism](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tranism/32/269_2.png) [@tranism](https://forum.kirupa.com/u/tranism)\
**Post date:** [July 26, 2003, 1:07am UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/1 "2003-07-26T01:07:07Z")

</div>

I’ve created a form with validation that works. Problem is when I turn it into a movie clip, and place the clip on my timeline, the form no longer works. Any ideas on why this may be happening? Perhaps I have to reference \_root but I’m not sure where.

---

<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:** [July 26, 2003, 2:19am UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/2 "2003-07-26T02:19:44Z")

</div>

More than likely, it’s a target problem. If you can make all your references relative (use “this” instead of “\_root”, etc), that should solve the problems.

---

<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:** [July 26, 2003, 7:01pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/3 "2003-07-26T19:01:23Z")

</div>

yup, for example

```auto

submit.onPress = function(){
this.getURL("blah.php",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:** [July 28, 2003, 4:26pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/4 "2003-07-28T16:26:17Z")

</div>

targeting with “this” isn’t working. here is the actionscript for my submit button.

[AS]this.formData.sendAndLoad(“[http://www.bcbg.com/js/flashmailscript.php](http://www.bcbg.com/js/flashmailscript.php)”, replyData, “post”);  
[/AS]

am I missing something? I tried it with root also. Didn’t help. sooo PLEASE 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:** [July 28, 2003, 4:36pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/5 "2003-07-28T16:36:07Z")

</div>

whats happening? are the variable’s not passing to your php page?

---

<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:** [July 28, 2003, 4:43pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/6 "2003-07-28T16:43:07Z")

</div>

Whats happening is whenever I hit the submit button, the form is never sent because its stuck on the validation cycle. For example;

in the email input field, a user types their email. The validation function looks to make sure that there is both an “@” and “.” characters. But now, even if I do type in a valid email address, the validation function still tells me its not in the correct form and there for won’t pass the variables to my script.

---

<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:** [July 28, 2003, 4:57pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/7 "2003-07-28T16:57:52Z")

</div>

Post the code you’re using to validate the form… 😉

---

<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:** [July 28, 2003, 5:01pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/8 "2003-07-28T17:01:37Z")

</div>

its pretty long but here it is. . .

[AS]//MY VALIDATION FUNCTIONS  
function vEmail(){  
if(formData.submit\_by == “”){  
errBox.setMessage(“You Must Fill In Your Email Address”);  
return false;}  
else{  
if(formData.submit\_by.indexOf(".",0) == -1 || formData.submit\_by.indexOf("@",0) == -1){  
errBox.setMessage(“Your Email Address Is Not In Correct Form”);  
return false;}  
else{  
return true;}  
}  
}

function vfirstName(){  
if (formData.first == “”){  
errBox.setMessage(“Oop’s, you forgot to fill in your first name”);  
return false; }  
else {  
return true};  
}

function vlastName(){  
if (formData.last == “”){  
errBox.setMessage(“Oop’s, you forgot to fill in your last name”);  
return false; }  
else {  
return true};  
}

function vAddress(){  
if (formData.address == “”){  
errBox.setMessage(“You must enter a valid Address”);  
return false; }  
else {  
return true};  
}

function vCity(){  
if (formData.city == “”){  
errBox.setMessage(“Oop’s, you forgot to fill in your city”);  
return false; }  
else {  
return true};  
}

function vState(){  
if (formData.state == “”){  
errBox.setMessage(“Oop’s, you forgot to fill in your state”);  
return false; }  
else {  
return true};  
}

function vZip(){  
if (formData.postal == “”){  
errBox.setMessage(“Oop’s, you forgot to fill in your zip code”);  
return false; }  
else {  
return true};  
}

//MY CLEAR ALL INPUT FIELDS FUNCTION FOR MY ‘CLEAR’ BUTTON  
function clrData(){  
formData.submit\_by = “”;  
email.text = “”;  
formData.first = “”;  
firstname.text = “”;  
formData.last = “”;  
lastname.text = “”;  
formData.address = “”;  
address.text = “”;  
formData.apt= “”;  
apartment.text = “”;  
formData.city = “”;  
city.text = “”;  
formData.state = “”;  
state.text = “”;  
formData.postal = “”;  
zip.text = “”;  
}

//MY REPLY FUNCTION AFTER MESSAGE IS SUCCESSFULLY OR UNSUCCESSFULLY SENT  
function myOnLoad(success){  
errBox.setEnabled(true);  
if(success){  
errBox.setIcon(“info”);  
errBox.setTitle(“Thank You”);  
errBox.setMessage(“Thank You for joining the BCBG mailing list.”);  
errBox.\_visible=true;  
clrData();  
}  
else{  
errBox.setIcon(“warning”);  
errBox.setTitle(“System Error”);  
errBox.setMessage(“Oop’s an error occured while submitting. Please try again.”);  
errBox.\_visible=true;  
}  
}

//MY SUBMIT FUNCTION TO SEND ALL INFORMATION TO MY SCRIPT SERVER SIDE  
function goPostal(){  
if(!vEmail()) {errBox.\_visible=true;return;}  
else if(!vfirstName()){errBox.\_visible=true;return;}  
else if(!vlastName()){errBox.\_visible=true;return;}  
else if(!vAddress()){errBox.\_visible=true;return;}  
else if(!vCity()){errBox.\_visible=true;return;}  
else if(!vState()){errBox.\_visible=true;return;}  
else if(!vZip()){errBox.\_visible=true;return;}

```
errBox.setIcon("info");
errBox.setTitle("Sending Mail");
errBox.setMessage("Your Email Is Being Submitted");
errBox._visible=true;
errBox.setEnabled(false);
this.maillist.formData.sendAndLoad("http://www.bcbg.com/js/flashmailscript.php", replyData, "post");

```

}[/AS]

---

<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:** [July 28, 2003, 5:49pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/9 "2003-07-28T17:49:44Z")

</div>

anybody?? ☹

---

<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:** [July 28, 2003, 6:20pm UTC](https://forum.kirupa.com/t/forms-in-a-movie-clip/26760/10 "2003-07-28T18:20:28Z")

</div>

honestly there is so much code, i’m not sure where to start. a good way to trouble shoot, is make a replica of what you want to do, with only one textbox, and get that to work. once to see how it works, you can implement it to your larger project
