开发者

AS3 tab through textfield issue (can't type during focus)

开发者 https://www.devze.com 2023-02-04 07:59 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消