Like the first version this form sends the messages to a certain e-mail address using a php file which has to be on a webserver that can handle php files.
Features:
- The form checks itself if all fields are filled out correctly
- The fields which are empty while trying to send the message will be displayed red
- the e-mail will be validated
- php sends the message to a certain e-mail address
- the target e-mail address can be easily changed in the php file
- the path to the php file can be easily changed in the according xml file
- a message occures if the e-mail is sent correctly
- a message occures if the message was not sent
- a message occure if the xml file could not be loaded
- the ActionScript code is AS 2 .0
Excerpt of the AS 2 .0 code
var xmlLoader: XML = new XML ;
var source:String = “xml/path.xml”;
xmlLoader.ignoreWhite = true;
xmlLoader.onLoad = function(loadedOK:Boolean) { numLoadings++; }
if(loadedOK) {
path = xmlLoader.firstChild.firstChild.firstChild.nodeValue;
} else {
if(numLoadings < maxLoadings) {
xmlLoader.load(source);
} else {
messageMC._visible = true;
messageMC.window.gotoAndStop("xmlError");
}
}
Excerpt of the send.php file
$message .= ”\n\nMessage: ” . $theMessage;
$headers = “From: $theEmail”;
$headers .= ”\nReply-To: $theEmail”;
$sentOK = mail($to, $subject, $message, $headers);
echo “sentOK=” . $sentOK;
Excerpt of the path.xml file
<?xml version= "1.0"?>
<contactForm>
<path>http://oller99.ol.funpic.de/flashdan/contactform/send.php</path>
</contactForm>
Unfortunately the form will not send any messages here in the preview so you always get an error message. If you want to see an working example embedded in HTML you can go here: see example
All this example embedded in HTML is also included in the download package.
I hope you like the new features
I´m thinking of adding a scrollbar to the message field which will appear wehn the text has to be scrollen … any purposes, feel free to drop me a line.










18 Purchases
24 Comments