从 TextInput 扩展组件时 Flex MXML 错误

发布于 2025-01-07 09:34:15 字数 611 浏览 6 评论 0原文

这个 Flex MXML 代码有什么问题吗?我收到错误消息(标有“X”的错误行)。代码很简单,但我找不到错误。

两次消息:“字符串”类型的标准属性“文本”的多个初始化值(从德语翻译)

 <?xml version="1.0" encoding="utf-8"?>
    <s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 focusIn="keyboardIsOpen=true" 
X                focusOut="keyboardIsOpen=false">
        <fx:Script>
            <![CDATA[
                //var
                static public var keyboardIsOpen:Boolean = false;
            ]]>
X       </fx:Script>
    </s:TextInput>

Whats wrong with this Flex MXML code? I'm getting error messages (error lines marked with "X"). Code is very simple but I cannot find the error.

Message both times: multiple initalisation values for standard property "text" of type "string" (translated from german)

 <?xml version="1.0" encoding="utf-8"?>
    <s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 focusIn="keyboardIsOpen=true" 
X                focusOut="keyboardIsOpen=false">
        <fx:Script>
            <![CDATA[
                //var
                static public var keyboardIsOpen:Boolean = false;
            ]]>
X       </fx:Script>
    </s:TextInput>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笨笨の傻瓜 2025-01-14 09:34:15

这是 Flex SDK 的问题。 Bug - 25184 根据错误报告中的注释,解决方法是显式设置像这样的文本属性。

<?xml version="1.0" encoding="utf-8"?>
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         focusIn="keyboardIsOpen=true" 
         focusOut="keyboardIsOpen=false"
         text="">
    <fx:Script>
        <![CDATA[
            //var
            static public var keyboardIsOpen:Boolean = false;
        ]]>
    </fx:Script>
</s:TextInput>

This is an issue with the Flex SDK. Bug - 25184 The workaround according to the comments in the bug report is to explicitly set the text property like this.

<?xml version="1.0" encoding="utf-8"?>
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         focusIn="keyboardIsOpen=true" 
         focusOut="keyboardIsOpen=false"
         text="">
    <fx:Script>
        <![CDATA[
            //var
            static public var keyboardIsOpen:Boolean = false;
        ]]>
    </fx:Script>
</s:TextInput>
长梦不多时 2025-01-14 09:34:15

我刚刚解决了你的问题。
我最初发现错误
然后错误显示为“此行有多个标记:
-焦点输出
-默认属性“文本”的多个初始值设定项值,类型为“字符串””

我刚刚更改了代码,添加了一个黑白属性

<?xml version="1.0" encoding="utf-8"?>                                      
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"    
focusIn="keyboardIsOpen=true" 
focusOut="keyboardIsOpen=false">
<s:fontSize>
    14
</s:fontSize>
<fx:Script>
    <![CDATA[
        static public var keyboardIsOpen:Boolean = false;
    ]]>
  </fx:Script>                                             

I ve just solve your problem.
I found error initially
then error showing is "Multiple markers at this line:
-focusOut
-Multiple initializer values for default property, 'text', of type 'String'"

I ve just change code, a property added b/w these

<?xml version="1.0" encoding="utf-8"?>                                      
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"    
focusIn="keyboardIsOpen=true" 
focusOut="keyboardIsOpen=false">
<s:fontSize>
    14
</s:fontSize>
<fx:Script>
    <![CDATA[
        static public var keyboardIsOpen:Boolean = false;
    ]]>
  </fx:Script>                                             

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文