s1001820
%Europe/Berlin %090 %2006, 02:10
Hallo ik heb een 2 tal vragen
Ik heb een simpel contactforulier in flash gescript die met php moet worden afgehaneld.
1 wat is de variabele die ik in php moet gebruiken voor de text invoervelden die ik in actionscript heb gebruikt?
2 hoe zend ik een bevestiging terug naar mijn flash movie
stop();
var registrationData:LoadVars = new LoadVars();
var errors:Array = new Array();
//functie legen invoervelden
function clearform() {
name_txt.text = "";
tel_txt.text = "";
email_txt.text = "";
valemail_txt.text = "";
heading_txt.text ="";
message_txt.text = "";
}
//roep functie invoervelden legen aan
clear_btn.addEventListener("click", clearform);
//validate naam invoerveld
function validateName() {
if (name_txt.text.length <2 || isNaN (name_txt.text) == false) {
errors.push("Please enter a valid name.");
name_txt.setStyle("color", 0x990000);
}
}
function validateForm(){
errorLog_lb.removeAll();
errors.length = 0;
validateName();
validateEmail();
confirmEmail ();
heading();
me();
if (errors.length > 0){
errorLog_lb.defaultIcon = "errorIcon";
var altColorArray:Array = new Array(0xF9F2F9, 0xECD9D9);
errorLog_lb.alternatingRowColors = altColorArray;
errorLog_lb.rollOverColor = 0xFFFFFF;
errorLog_lb.selectioColor = 0xFFFFFF;
errorLog_lb.dataProvider = errors;
} else{
registrationData.name = name_txt.text;
registrationData.tel = tel_txt.text;
registrationData.email = email_txt.text;
registrationData.valemail = valemail_txt.text;
registrationData.heading = heading_txt.text;
registrationData.message = message_txt.text;
registrationData.onLoad = function(){
gotoAndStop("Confirm");
}
registrationData.sendAndLoad("http://www.xcesmedia.com/contact.php", registrationData, "POST");
}
}
submit_btn.addEventListener("click",validateForm);
//validate email
function validateEmail(){
if(email_txt.text.indexOf("@")<2){
errors.push("@ missing in emal or in the wrong place.");
email_txt.setStyle("color", 0x990000);
}
if (email_txt.text.lastIndexOf(".") <= (email_txt.text.indexOf("@") + 2)) {
errors.push(". missing in email or in the wrong place.");
}
if (email_txt.text.length < 8){
errors.push("Email addres not long enough.");
email_txt.setStyle("color",0x990000);
}
}
//cheak if e-mails are equal
function confirmEmail (){
if (email_txt.text != (valemail_txt.text)){
errors.push("Your emails aren't equal");
valemail_txt.setStyle("color",0x990000);
}
}
//cheak if heading isn'y emty
function heading(){
if (heading_txt.text.length <2 || isNaN (message_txt.text) == false){
errors.push("Don't leave this field black");
heading_txt.text.setStyle("color", 0x990000);
}
}
//cheak if message isn'y emty
function me (){
if (message_txt.text.length <2 || isNaN (message_txt.text)== false){
errors.push("Don't leave this field black");
message_txt.text.setStyle("color", 0x990000);
}
}
function resetColor(eventObj:Object){
eventObj.target.setStyle("color", 0x000000);
}
name_txt.addEventListener("focusIn",resetColor);
tel_txt.addEventListener("focusIn",resetColor);
email_txt.addEventListener("focusIn",resetColor);
valemail_txt.addEventListener("focusIn",resetColor);
heading_txt.addEventListener("focusIn",resetColor);
message_txt.addEventListener("focusIn",resetColor);
_global.style.setStyle("themeColor", 0xBDDDEB);
Groetjes erik
Ik heb een simpel contactforulier in flash gescript die met php moet worden afgehaneld.
1 wat is de variabele die ik in php moet gebruiken voor de text invoervelden die ik in actionscript heb gebruikt?
2 hoe zend ik een bevestiging terug naar mijn flash movie
stop();
var registrationData:LoadVars = new LoadVars();
var errors:Array = new Array();
//functie legen invoervelden
function clearform() {
name_txt.text = "";
tel_txt.text = "";
email_txt.text = "";
valemail_txt.text = "";
heading_txt.text ="";
message_txt.text = "";
}
//roep functie invoervelden legen aan
clear_btn.addEventListener("click", clearform);
//validate naam invoerveld
function validateName() {
if (name_txt.text.length <2 || isNaN (name_txt.text) == false) {
errors.push("Please enter a valid name.");
name_txt.setStyle("color", 0x990000);
}
}
function validateForm(){
errorLog_lb.removeAll();
errors.length = 0;
validateName();
validateEmail();
confirmEmail ();
heading();
me();
if (errors.length > 0){
errorLog_lb.defaultIcon = "errorIcon";
var altColorArray:Array = new Array(0xF9F2F9, 0xECD9D9);
errorLog_lb.alternatingRowColors = altColorArray;
errorLog_lb.rollOverColor = 0xFFFFFF;
errorLog_lb.selectioColor = 0xFFFFFF;
errorLog_lb.dataProvider = errors;
} else{
registrationData.name = name_txt.text;
registrationData.tel = tel_txt.text;
registrationData.email = email_txt.text;
registrationData.valemail = valemail_txt.text;
registrationData.heading = heading_txt.text;
registrationData.message = message_txt.text;
registrationData.onLoad = function(){
gotoAndStop("Confirm");
}
registrationData.sendAndLoad("http://www.xcesmedia.com/contact.php", registrationData, "POST");
}
}
submit_btn.addEventListener("click",validateForm);
//validate email
function validateEmail(){
if(email_txt.text.indexOf("@")<2){
errors.push("@ missing in emal or in the wrong place.");
email_txt.setStyle("color", 0x990000);
}
if (email_txt.text.lastIndexOf(".") <= (email_txt.text.indexOf("@") + 2)) {
errors.push(". missing in email or in the wrong place.");
}
if (email_txt.text.length < 8){
errors.push("Email addres not long enough.");
email_txt.setStyle("color",0x990000);
}
}
//cheak if e-mails are equal
function confirmEmail (){
if (email_txt.text != (valemail_txt.text)){
errors.push("Your emails aren't equal");
valemail_txt.setStyle("color",0x990000);
}
}
//cheak if heading isn'y emty
function heading(){
if (heading_txt.text.length <2 || isNaN (message_txt.text) == false){
errors.push("Don't leave this field black");
heading_txt.text.setStyle("color", 0x990000);
}
}
//cheak if message isn'y emty
function me (){
if (message_txt.text.length <2 || isNaN (message_txt.text)== false){
errors.push("Don't leave this field black");
message_txt.text.setStyle("color", 0x990000);
}
}
function resetColor(eventObj:Object){
eventObj.target.setStyle("color", 0x000000);
}
name_txt.addEventListener("focusIn",resetColor);
tel_txt.addEventListener("focusIn",resetColor);
email_txt.addEventListener("focusIn",resetColor);
valemail_txt.addEventListener("focusIn",resetColor);
heading_txt.addEventListener("focusIn",resetColor);
message_txt.addEventListener("focusIn",resetColor);
_global.style.setStyle("themeColor", 0xBDDDEB);
Groetjes erik