///////////////////////////////////////////////////////////////////////////////
//
txtFeldArr = ["txtName", "txtEmail", "txtMessage"];
txtLabelArr = [" ", " ", " "];
//
///////////////////////////////////////////////////////////////////////////////
//
fncClear = function (obj1, index) {
obj1.text = txtLabelArr[index];
};
//----------------------------------------------------------------------------
fncOldStyle = function (obj2) {
obj2.textColor = "0x000000";
obj2.borderColor = "0xCCCCCC";
obj2.backgroundColor = "0xFFFFFF";
};
//----------------------------------------------------------------------------
fncNewStyle = function (obj3) {
obj3.textColor = "0x000000";
obj3.borderColor = "0xCCCCCC";
obj3.backgroundColor = "0xCCCCCC";
};
//----------------------------------------------------------------------------
fncCheckContent = function (obj4) {
if (obj4.text == txtLabelArr[obj4.i]) {
obj4.text = "";
} else if ((obj4.text == "")) {
fncClear(obj4, obj4.i);
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncInit = function () {
for (i=0; i<txtFeldArr.length; i++) {
currentTxtFeld = 0;
prevtTxtFeld = 0;
// --------------------------------------------------------------------
mcFormular[txtFeldArr[i]].i = i;
// --------------------------------------------------------------------
fncClear(mcFormular[txtFeldArr[i]], mcFormular[txtFeldArr[i]].i);
fncOldStyle(mcFormular[txtFeldArr[i]]);
// --------------------------------------------------------------------
mcFormular[txtFeldArr[i]].onSetFocus = function() {
prevtTxtFeld = currentTxtFeld;
currentTxtFeld = this;
// ----------------------------------------------------------------
fncNewStyle(currentTxtFeld);
fncOldStyle(prevtTxtFeld);
// ----------------------------------------------------------------
fncCheckContent(currentTxtFeld);
fncCheckContent(prevtTxtFeld);
};
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncSend = function () {
felderVoll = false;
emailRichtig = false;
for (i=0; i<txtFeldArr.length; i++) {
if ((mcFormular[txtFeldArr[i]].text == "") || (mcFormular[txtFeldArr[i]].text == txtLabelArr[i])) {
mcFormular[txtFeldArr[i]].textColor = "0xCCCCCC";
mcFormular.txtStatus.text = "Alle Felder korrekt ausfüllen";
felderVoll = false;
} else {
felderVoll = true;
}
// --------------------------------------------------------------------
mcFormular.txtEmail.textColor = "0xCCCCCC";
mcFormular.txtStatus.text = "Alle Felder bitte korrekt ausfüllen";
mcFormular.txtStatus.textColor = "0x999999";
emailRichtig = false;
emailRichtig = true;
}
// ------------------------------------------------------------------------
if ((felderVoll == true) && (emailRichtig == true)) {
mcFormular.txtStatus.text = "Daten gesendet";
mcFormular.txtStatus.size = 16;
mcFormular.txtStatus.textColor = "0x666666";
mcFormular.loadVariables("flashMail.php", "POST");
}
};
//
///////////////////////////////////////////////////////////////////////////////
//
mcFormular.btnClear.txtLabel.text = "löschen";
mcFormular.btnSend.txtLabel.text = "senden";
//----------------------------------------------------------------------------
mcFormular.btnClear.onRollOver = mcFormular.btnSend.onRollOver=function () {
this.txtLabel.textColor = "0x000000";
};
mcFormular.btnClear.onRollOut = mcFormular.btnSend.onRollOut=function () {
this.txtLabel.textColor = "0x000000";
};
//----------------------------------------------------------------------------
mcFormular.btnClear.onPress = mcFormular.btnSend.onPress=function () {
this.txtLabel._x = this.txtLabel._y += 1;
};
mcFormular.btnClear.onReleaseOutside = mcFormular.btnSend.onReleaseOutside=function () {
this.txtLabel.textColor = "0xCCCCCC";
this.txtLabel._x = this.txtLabel._y -= 1;
};
//----------------------------------------------------------------------------
mcFormular.btnClear.onRelease = function() {
this.txtLabel._x = this.txtLabel._y -= 1;
fncInit();
};
mcFormular.btnSend.onRelease = function() {
this.txtLabel._x = this.txtLabel._y -= 1;
fncSend();
};
//
///////////////////////////////////////////////////////////////////////////////
//
fncInit();