onKillfocus doesn't function as expected. I am using Flash Player 10 for publishing.
feedback = "Type Here";
tf1_txt.onSetFocus = function() : Void
{
if (feedback == "Type Here") {
feedback = "";
}
};
tf1_txt.onKillFocus = function() : Void
{
if (feedback == "") {
feedback = "Type Here";
}
};
then you're not changing focus or your expectations are not inline with your actionscript.
just what do you expect that code to do?
When I click inside the textfield the text Type Here should clear. Which is working fine.
In case I dont enter text after clicking inside and click anywhere outside the textfield, it should show Type Here again in the textfield.
the code you showed wouldn't do either of the things you expect or see unless you assigned a variable to your textfield which is not recommended. use your textfield's text property and make sure your textfield is single line:
tf1_txt.multiline=false;
tf1_txt.onSetFocus = function() : Void
{
if (tf1_txt.text == "Type Here") {
tf1_txt.text= "";
}
};
tf1_txt.onKillFocus = function() : Void
{
if (tf1_txt.text == "") {
tf1_txt.text = "Type Here";
}
};