【问题标题】:Why does this non-descriptive error happen when I try to build this mxml file?为什么在我尝试构建此 mxml 文件时会发生此非描述性错误?
【发布时间】:2014-09-18 22:14:02
【问题描述】:

尝试构建简单的 MXML 文件时出现以下错误:

Build halted with errors (fcsh).

这是 MXML:

<?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">

    <s:Label id="titleLabel" x="50" y="50" fontFamily="Arial" fontWeight="bold" text="My first Flex 4 application"/>

    <fx:Script>
        <![CDATA[

            public function example() {
                speakTextInput.text = "This is an example of horrible code!";
            }

        ]]>
    </fx:Script>

    <s:HGroup x="50" y="70" width="80%">
        <s:Button id="speakButton" label="Say Something!" />
        <s:TextInput id="speakTextInput" width="100%" text="" />
    </s:HGroup>

</s:Application>

【问题讨论】:

    标签: actionscript-3 apache-flex actionscript flex4 mxml


    【解决方案1】:

    也许你的编译器不喜欢没有返回值类型声明的函数。尝试更改为:

    public function example():void
    

    【讨论】:

    • 就是这样!谢谢你:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-29
    • 2012-05-02
    • 2023-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多