簡體   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