So first of all, when I don't assign tabIndex to my textfields, I can tab though them and type in them. But I can't determine the order of tabbing of course.
When I assign tabIndex, I can determine the order of tabbing, but then the yellow focus box appears and I can't type in the textfield, unless I click in it.
Any help?
Edit, my code:
I use a TextFieldFactory for all my labels, input fields and buttons:
public function TextFieldFactory(text:String, fontSize:uint, textfieldType:String, button:Boolean)
开发者_如何学Go{
t = new TextField();
var format:TextFormat = new TextFormat("Diego Regular", fontSize, 0x000000);
format.align = TextFieldAutoSize.LEFT;
t.defaultTextFormat = format;
t.embedFonts = true;
t.autoSize = TextFieldAutoSize.LEFT;
t.text = text;
if(textfieldType == "input") {
t.type = TextFieldType.INPUT;
t.autoSize = TextFieldAutoSize.NONE;
t.border = true;
t.width = 200;
t.text = "";
} else {
t.type = TextFieldType.DYNAMIC;
t.selectable = false;
}
t.height = 25;
t.wordWrap = false;
if(button){
t.mouseEnabled = true;
t.background = true;
this.buttonMode = true;
this.mouseChildren = false;
t.backgroundColor = 0x000000;
t.textColor = 0xFFFFFF;
}
addChild(t);
}
In the class where I make a new instance of this factory, there I assign tabIndex to it.
精彩评论