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


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?


bSubmit.onRelease = function()
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 = “[email protected]”; //Change this to your e-mail.
tName.text = “Sending Message…”;
tEmail.text = “”;
tComments.text = “”;
tMobilen.text = “”;
tName.text = “message sent”;
lvSend.sendAndLoad(‘mail.php’, lvReply, ‘POST’);