# Problem with contact form in main.swf

**URL:** <https://forum.kirupa.com/t/problem-with-contact-form-in-main-swf/65439>\
**Category:** Uncategorized\
**Created:** [September 26, 2004, 12:05pm UTC](https://forum.kirupa.com/t/problem-with-contact-form-in-main-swf/65439 "2004-09-26T12:05:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsundqvi](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tsundqvi](https://forum.kirupa.com/u/tsundqvi)\
**Post date:** [September 26, 2004, 12:05pm UTC](https://forum.kirupa.com/t/problem-with-contact-form-in-main-swf/65439/1 "2004-09-26T12:05:06Z")

</div>

Hi  
I just made my first contact form with flash MX. It works very well. But when I load the contact.swf into main movie, something goes wrong because I receive empty e-mails. If I run (only) contact.swf by itself, I’ll get e-mail with content. I’m pretty sure that this is a very simple case but I can’t solve it by myself. I would be very happy if someone helped me.

Thanking for advance

---

<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:** [September 26, 2004, 2:42pm UTC](https://forum.kirupa.com/t/problem-with-contact-form-in-main-swf/65439/2 "2004-09-26T14:42:34Z")

</div>

look at how you are referring to the movie that contact is being loaded into.  
if you’re doing something like:  
message = \_root.textbox.text;  
then you’ll probably want to do:  
message = \_root.content.textbox.text; //where content is the name of the movie the contact form is being loaded into.

---

<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:** [September 26, 2004, 6:12pm UTC](https://forum.kirupa.com/t/problem-with-contact-form-in-main-swf/65439/3 "2004-09-26T18:12:03Z")

</div>

Thanks for consideration

Sorry, but I can’t modify your tips in this case because I’m just a beginner in actioscripting. [http://www.sloop.fi/testi is the address of my site. Word “yhteystiedot” in the navigation bar means contact. [url=“http://www.sloop.fi/testi/yhteystiedot.html”]http://www.sloop.fi/testi/yhteystiedot.html](http://www.sloop.fi/testi) is the address where the contact form works.

**This is the code in the layer1 of contact.swf:**

function clrData(){  
this.formData.name = “”;  
this.nameIn.text = “”;  
this.formData.company = “”;  
this.companyIn.text = “”;  
this.formData.address = “”;  
this.addressIn.text = “”;  
this.formData.zip = “”;  
this.zipIn.text = “”;  
this.formData.city = “”;  
this.cityIn.text = “”;  
this.formData.phone = “”;  
this.phoneIn.text = “”;  
this.formData.email = “”;  
this.emailIn.text = “”;  
this.formData.message = “”;  
this.messageIn.text = “”;  
phone2In.setValue(false);  
letterIn.setValue(false);  
email2In.setValue(false);  
permissionIn.setValue(true);

}

function myOnLoad(success){  
errBox.setEnabled(true);  
if(success){  
errBox.setIcon(“info”);  
errBox.setTitle(“Kiitos”);  
errBox.setMessage(“Kiitos viestistäsi. Vastaamme sinulle mahdollisimman nopeasti”);  
errBox.\_visible=true;  
clrData();  
}  
else{  
errBox.setIcon(“Virhe”);  
errBox.setTitle(“Järjestelmävirhe”);  
errBox.setMessage(“Valitettavasti lähetyksen aikana havaittiin ongelmia. Ole hyvä täytä ja lähetä lomake uudelleen”);  
errBox.\_visible=true;  
}  
}  
function goPostal(){

errBox.setIcon(“info”);  
errBox.setTitle(“Viestiä lähetetään”);  
errBox.setMessage(“Viestiä lähetetään”);  
errBox.\_visible=true;  
errBox.setEnabled(false);  
formData.sendAndLoad(“[http://sloop.fi/cgi-bin/Cmail.cgi](http://sloop.fi/cgi-bin/Cmail.cgi)”, replyData, “post”);  
}

**And here’s the code in layer2 (contact.swf):**

formData = new LoadVars();  
formData.name = “”;  
formData.company = “”;  
formData.address = “”;  
formData.zip = “”;  
formData.city = “”;  
formData.phone = “”;  
formData.email = “”;  
formData.message = “”;  
formData.phone2 = “”;  
formData.letter = “”;  
formData.email2 = “”;  
formData.permission = “”;  
replyData = new LoadVars();  
replyData.onLoad = myOnLoad;  
globalStyleFormat.FMessageBoxTitleText = new TextFormat( “Arial Bold”, 15, 0xffffff);  
globalStyleFormat.applyChanges();  
errBox.setButtonWidth(50);

**This is the code of contact button in the main movie (main.swf):**

on (release) {  
loadMovieNum(“contact.swf”, 1);  
}

Thanks,  
Tommi
