繁体   English   中英

Flex中Flash MovieClip上的Tab索引

[英]tab index on flash movieclip in flex

我有一个在flex中弹出的表单,它是UIComponent中包含的动画片段。 此动画片段中包含表单字段。

由于某种原因,我无法使Tab按钮正常工作,因此无法在各个字段之间切换。 我用tabindex设置了每个字段,但这不起作用。

除此之外,我还有什么需要做的吗? 这基本上就是我正在使用的所有代码:

email.tabIndex = 1; city.tabIndex = 2; firstName.tabIndex = 3;

等等

这是因为flex不起作用吗? 如果是这样,有什么解决方法?

您是否尝试过将新的FocusManager实例添加到包含动画片段的UIComponent中? 我不确定,但也许。

我还能想到的另一件事是表单元素和包含的对象的tabEnabled属性。

希望它能使您靠近。

罗布,祝你好运

//////////////////////////////////////////不幸的是,我无法使其正常工作,但是我将代码发送给您,也许您可​​以使用它来做一些事情。

我试图在其中添加一个动画片段和文本字段,但它是相同的,完全没有TAB。 因此,我只是将文本字段添加到UIComponent并将所有可能的选项卡和与焦点相关的属性设置为true-不走运:(。

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
        import mx.core.UIComponent;
            import flash.display.MovieClip;
            import flash.text.TextField;

            protected function init(event:Event):void
            {                                                               
                var i:uint = 0;
                var l:uint = 4;
                while (i < l)
                {
                    var tf:TextField = new TextField();
                    tf.name = "tf_" + i;
                    tf.width = 200;
                    tf.height = 21;
                    tf.border = true;
                    tf.type = "input";
                    tf.tabIndex = i;
                    tf.tabEnabled = true;
                    tf.text = "tabIndex = " + String(tf.tabIndex);
                    tf.x = 50;
                    tf.y = tf.height * i + 10 * i + 100;
                    uicomp.addChild(tf);
                    ++i;
                }
            };
        ]]>
    </fx:Script>

    <mx:UIComponent hasFocusableChildren="true" tabChildren="true" tabEnabled="true" tabFocusEnabled="true" id="uicomp" width="100%" height="100%" addedToStage="init(event);" />

</s:Application>

抱歉,这就是我现在所能做的。 如果您得到答案,请告诉我,我很热衷。

干杯,罗布

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM