Jump to content

Flash Forms


funkyjunky

Recommended Posts

Hey guys.I want to make a text box in which someone inputs there email address and submits it. then it is sent to my email adress (esm@hotmail.co.uk) so i can see what they have submitted.Its going to be on the home page of my flash website.any questions/answers welcome!Ed

Link to comment
Share on other sites

You must have a host support SMPTHave a code ???
SMPT? :) And no i dont have a code!!!And if its too complicted to explain...anyone got a link to a place where it can teach me!!Ed
Link to comment
Share on other sites

:) WOAH!Complex or what!!But yer thats EXACTLY what i wanted =]Thanks again smiles Your a star!!Ed
Link to comment
Share on other sites

first, try "mailto:esm@hotmail.co.uk" in your getURL attribute on a button.if that works (can't remember if flash processes that, then you have the crudest way to do it.The only other way is to have your flash form post to a page on your server that can process the request - something liek asp, php, or coldfusion.

Link to comment
Share on other sites

The only other way is to have your flash form post to a page on your server that can process the request - something liek asp, php, or coldfusion.
I have NO knowledge in either of those!!Plus i dont have a host yet!Sugestions??Ed
Link to comment
Share on other sites

I went on another forum!

-- Sorry if this is a bit long winded, but since you said you have no idea how to do it, I thought I'd go overkill and explain it step by step. --Well, there's several steps to this. Yes, you'll need access to a server with a script to send emails based on imput in the url. The most typical language to do it in would be php, and the server would need an SMTP application.As far as flash goes, you can use a component for the input box.Inside of Flash 8, go to Window/Components.Inside of that window, go to User Interface/TextInput.You can drag-and-drop it to create an instance of it, and you can edit it through both the Properties and Parameters window. (WIndow/Properties/Properties Window/Properties/Parameter)Most importantly, under Properties, is the <Instance Name> box. This is what the input box will be reffered to as inside of actionscript.The input box alone will allow users to type text into it, but will not submit anything as is. You will need to either make a button to submit, or add a listener to Key.isDown. To access the data inside of the input box, refference it, and use its .text property.If this makes sense, great. If not, I'll go into an example.Example-Place an input box. Inside of properties, give it an instance name of "email." Make a movie clip to serve as your button; name it whatever you want. Select your button, and give it the actionscript:
on(press) {var userInput:String;userEmail = _parent.email.text;this.loadVariables("Location_of_Script.php?Em ail_Variable=" + userEmail);_parent.email.text = " ";}

But what should the php file say?
Link to comment
Share on other sites

That is a server side file that I mentioned would be the alternative to using mailto.The php file would have to process the form and generate an email accordingly.Several posts have addressed this but this should give you enough to get the real basics down:http://www.w3schools.com/php/php_mail.aspGood Luck

Link to comment
Share on other sites

Thanks for the help.But i really still cant do it...Will someone write the code for me :) Im REALLY sorry!E xxx

Link to comment
Share on other sites

Ok.Php file im using:

<?php/***************************************************\ * PHP 4.1.0+ version of email script. For more * information on the mail() function for PHP, see * [url="http://www.php.net/manual/en/function.mail.php"]http://www.php.net/manual/en/function.mail.php[/url]\***************************************************/// First, set up some variables to serve you in// getting an email.  This includes the email this is// sent to (yours) and what the subject of this email// should be.  It's a good idea to choose your own// subject instead of allowing the user to.  This will// help prevent spam filters from snatching this email// out from under your nose when something unusual is put.$sendTo = "esm@hotmail.com";$subject = "Mailing List";// variables are sent to this PHP page through// the POST method.  $_POST is a global associative array// of variables passed through this method.  From that, we// can get the values sent to this page from Flash and// assign them to appropriate variables which can be used// in the PHP mail() function.// header information not including sendTo and Subject// these all go in one variable.  First, include From:$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";// next include a replyto$headers .= "Reply-To: " . $_POST["email"] . "\r\n";// often email servers won't allow emails to be sent to// domains other than their own.  The return path here will// often lift that restriction so, for instance, you could send// email to a hotmail account. (hosting provider settings may vary)// technically bounced email is supposed to go to the return-path email$headers .= "Return-path: " . $_POST["email"];// now we can add the content of the message to a body variable$message = $_POST["message"];// once the variables have been defined, they can be included// in the mail function call which will send you an emailmail($sendTo, $subject, $message, $headers);?>

Fla file: http://www.pulse-games.co.uk/home.flaCan some one help????E x x

Link to comment
Share on other sites

  • 1 month later...

it is very simple actually, I will post a working php program to go with the flash forms(when I get home). I just recently learned to do the exact same thing you are doing.alot of the tutorials on the internet you will find have errors and will just fustrate you.

Link to comment
Share on other sites

okay I am home.here is the working php file. (my form had name / message /and email fields.<html><head> <title>Untitled</title></head><body><? $to = "email@domain.com"; $subject = "subject"; $msg = "name\n$name\n\n\n\n"; $msg .= "message\n$message\n\n\n\n"; $msg .= "email\n$email\n\n\n\n"; mail($to, $subject, $msg);?></body></html>(By the way the \n's in that php file mean nothing more than a <br> tag in html. it is just a breakline, if you dont know what <br> is its just like pushing enter and going to the next line when you are typeing in a text file.)--------in flash give your textfields variable namesand on your submit button add this actionScript:on (release) { loadVariablesNum("phpfilename.php", 0, "POST");}also either "GET" or "POST" will work.hope this helps! -AstralAaron

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...