Hi, so I’ll try and explain this very simply.
I have an input text field that is on the stage, and given an id, and then I access it with code.
private var _dtf:TextField;
I do things to it through out the movie… like add a listener for the enter key being pressed.
_dtf.addEventListener(KeyboardEvent.KEY_DOWN, keyPress, false, 0, true);
private function keyPress(e:KeyboardEvent) : void {
if(e.charCode == 13){
answerQuestion();
}
}
and also I listen for it’s focus event so that I can change the “default” text when the user clicks inside of it.
_dtf.addEventListener(FocusEvent.FOCUS_IN, focus, false, 0, true);
_dtf.addEventListener(FocusEvent.FOCUS_OUT, focus, false, 0, true);
on focus in, I set the _dtf.text to “”; or " ";
private function focus(e:FocusEvent) : void {
if(e.type == “focusIn”) {
_dtf.htmlText = “”;
_dtf.alpha = 1;}else{
_dtf.alpha = .5;
}
so as you can see, if they exit the text input field, i set the text to half alpha and then I was going to reset it to the default text, but if they click a button to the right, it changes focus and therefore changes _dtf.text to the default which I don’t want.
But that’s not the real problem. The REAL problem is that if they click in and out of the textfield, eventually the caret will move to the farthest left inside the textfield box, and the user can’t input anything… any typing yields no result. Why would this input box fail like this so badly?
thanks for any guidance! if any of you know an “advanced” input text field class that might not have the same problems, that would be amazing.