# Multiple onrelease functions (Contact form) submit and then go to next frame

**URL:** <https://forum.kirupa.com/t/multiple-onrelease-functions-contact-form-submit-and-then-go-to-next-frame/323208>\
**Category:** flash\
**Created:** [June 21, 2011, 9:41am UTC](https://forum.kirupa.com/t/multiple-onrelease-functions-contact-form-submit-and-then-go-to-next-frame/323208 "2011-06-21T09:41:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrillemannen](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@chrillemannen](https://forum.kirupa.com/u/chrillemannen)\
**Post date:** [June 21, 2011, 9:41am UTC](https://forum.kirupa.com/t/multiple-onrelease-functions-contact-form-submit-and-then-go-to-next-frame/323208/1 "2011-06-21T09:41:37Z")

</div>

Hi!

I have a problem with a contactform in flash.

I have a working contact fom made in flash , which i want to add a function to.  
When pressing the “submit button” it sends me an email.  
And the text "message sent apears.

I would like to add a onreleaseandgotoandplay function which takes me to the frame 2.

i have tried to place this function into the button, it works fine taking me to frame 2, but then it does not send me an email…

I guess the second function should be placed in the code below to work, someone who knows how to do this?

Actionscript

bSubmit.onRelease = function()  
{  
email();  
}  
function email()  
{  
var sMessage = "Name: " + tName.text + "  
E-mail: " + tEmail.text + "  
Comments: " + tComments.text + "  
Phone: " + tPhone.text;  
lvSend = new LoadVars();  
lvReply = new LoadVars();  
lvSend.msg = sMessage;  
lvSend.address = “[info@mail.com](mailto:info@mail.com)”; //Change this to your e-mail.  
tName.text = “Sending Message…”;  
tEmail.text = “”;  
tComments.text = “”;  
tMobilen.text = “”;  
lvReply.onLoad()  
{  
tName.text = “message sent”;  
}  
lvSend.sendAndLoad(‘mail.php’, lvReply, ‘POST’);  
}
