I have a Input text area set up for a contact form.
I want the area to display “Email”, and for the alpha to be 50%. When you click on the text field to put in your email address, I want the original value to be removed and for the alpha to reset to 100%.
I’ve been able to accomplish this fine so far using the code below; the problem is that I only want the value to become blank again if the user hasn’t entered in information yet (this way if the user wants to come back and change something, it won’t all be deleted when the text area is clicked on).
I tried using an “if” statement, but Flash seems to just ignore it and perform the function either way.
Any solutions?
Here is the code that I came up with:
email.text = “email”;
email._alpha = 50;
email.onSetFocus = function() {
email.text = “”;
email._alpha = 100;
}
email.onKillFocus = function() {
email.text = “”
email._alpha = 50;
}
and here is the code I tried using an “if” statement:
email.text = “email”;
email._alpha = 50;
email.onSetFocus = function() {
if(email.text = “email”) {
email.text = “”;
email._alpha = 100;
}
}
email.onKillFocus = function() {
if(email.text = “”) {
email.text = “”
email._alpha = 50;
}
}