Skip to main content
Known Participant
April 3, 2007
Question

Emailing from Flash 8

  • April 3, 2007
  • 13 replies
  • 1225 views
I have built a contact form for a site (my first proper flash site) and it wont work?! i built it according to a lot of looking through online tutorials. Im using input text boxes and labeling them using the var: property box like in the tutorials but when it come time to send i get an error report from my ISPs cgi script saying i havent defined the recipent - which i have done according to examples i have seen ie creating a input box labeling var: recipient and typing my email into the box

this is the AS i use (attached to submit button) to send:
on (release) {
getURL(" http://www.mydomain.com/bin/FormMail.cgi", "_blank", "POST");
}

What am i doing wrong?

PLEASE HELP - IM REALLY CONFUSED!?
This topic has been closed for replies.

13 replies

kglad
Community Expert
Community Expert
June 27, 2007
that's great! (and, you're welcome.)
Known Participant
June 27, 2007
Thanks again for the help
I got a copy of the script my ISP use and is all working great now!
kglad
Community Expert
Community Expert
June 25, 2007
Known Participant
June 25, 2007
I had a look through cross-domain policy and I dont think it will work either.
thanks heaps for the help
Any advice on getting hold of a CGI script that i can use?
kglad
Community Expert
Community Expert
June 25, 2007
it would fix the problem if you had the cgi script in your own domain and that would probably be best.

i'm not even sure a cross-domain policy will help because it's the cgi script that should refuse to execute when being called from outside its domain.
Known Participant
June 25, 2007
Would it fix the problem if i have the CGI Script on my own domain?
or is it easier to set up a cross-domain policy file?
kglad
Community Expert
Community Expert
June 25, 2007
you need a cross-domain policy file to allow your swf to load data from godzone.net.nz.. you can start reading about it in the help files under the sendAndLoad method of loadvars.
Known Participant
June 24, 2007
One other thing. I just tested in on my computer within it html holder page (prev. tests from "test movie" within flash) and have similar problem. This time i get a popup from flash about settings but the settings seem to be OK? Is there meant to be some HTML code with the holder to allow this form to be sent?
kglad
Community Expert
Community Expert
June 24, 2007
i assume your files are on the same server as the cgi script (on godzone.net.nz).

if so, use a relative path from your swf's html page to the cgi script. for example:

Known Participant
June 25, 2007
No
The swf etc are on my domain alpha.org.nz (hosted by godzone.net.nz) and the script is on godzone.net.nz
I have been playing with the setting as i think it may actually be a flash player thing. When i test it from with the html holder a pop up message from flash player comes up
"Adobe flash player has stopped a potentially unsafe operation......"
It then says i have to let this app communicate with the internet by changing my settings, Which i have but it still come up with this same message each time.
Have you had this problem?
kglad
Community Expert
Community Expert
April 12, 2007
great! and you're welcome.
Known Participant
June 24, 2007
Hi me again
I just finished the site that this was for and uploaded the files to my hosts server but this form no longer works!?. its fails to send. This is really strange because if i test it on my own computer before uploading the email sends (and is recieved) exactly the way its meant to. the only difference between the working and not working version is swf doesnt work once uploaded to web.
Do you know any reason why this would be? the cgi script is provided by the webhost and is located on there domain if that helps
Any advice? Thanks
kglad
Community Expert
Community Expert
April 12, 2007
that code should be attached to a frame of the main timeline. and that frame should play before your button is released.

if you know the code that's supposed to be used by a html form using FormMail.cgi, post it.
Known Participant
April 12, 2007
Im not sure if this is what you meant but this is the HTML code for the page the flash for will be replacing
++++++++++++
<form action=" http://www.godzone.net.nz/bin/FormMail.cgi" method="POST">
<input type="hidden" name="recipient" value="paul@alpha.org.nz">
<input type="hidden" name="redirect" value=" http://www.alpha.org.nz/youth/thanks.htm">
<input type="hidden" name="subject" value="Contact from Website">
<P>Your Name:
<BR><INPUT TYPE="text" NAME="Name " style="width: 400; background-color: #ffffff">
<P>Email address:
<BR><INPUT TYPE="text" NAME="From " style="width: 400; background-color: #ffffff">
<P>Message:
<BR><TEXTAREA NAME="comments " style="width: 400; height: 100px; background-color: #ffffff "></TEXTAREA>
<P><INPUT TYPE="submit" VALUE=" Send Your Message " style="background-color: #556677; color: #ffffff">
+++++++++++++++++

Only require field is recipient - the rest can have any name we require (the cgi script is provided by our web host)

Hope this helps
kglad
Community Expert
Community Expert
April 12, 2007
ok, here's the code you should use on your button. you'll need to remove the commented lines and use the correct reference for the needed variables: