AS3错误:通过具有静态类型Class的引用访问可能未定义的属性STANDARD_OUTPUT_DATA

时间:2012-08-15 07:40:20

标签: actionscript-3 flex ant

我有一个Flex AIR项目,可以在Flex Builder 4.6中编译和运行。我正在尝试创建一个将构建项目的Ant脚本。在这些行上我得到了这些错误:

        _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
        _process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
        _process.addEventListener(NativeProcessExitEvent.EXIT, onNativeProcessExit);

我收到了这个错误:

[mxmlc] MyClass.as(190): col: 44 Error: Access of possibly undefined property STANDARD_OUTPUT_DATA through a reference with static type Class.
[mxmlc]             _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
[mxmlc]                                                     ^
[mxmlc] MyClass.as(191): col: 44 Error: Access of possibly undefined property STANDARD_INPUT_PROGRESS through a reference with static type Class.
[mxmlc]             _process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);

据我所知,这些是在frameworks / libs / air / airglobal.swc中定义的。我想我将其包含在下面的compiler.external-library-path元素中。

我的build.xml ant脚本的编译目标如下所示:

<target name="compile" depends="init">
  <mxmlc file="${MAIN_SOURCE_FILE}" output="${DEPLOY_DIR}/${APP_NAME}.swf"
       services="${APP_ROOT}/services/flex/services-config.xml">
    <swf-version>13</swf-version>
    <locale>en_US</locale>
    <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>

    <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
     <source-path path-element="${FLEX_HOME}/frameworks"/>
    <source-path path-element="${APP_ROOT}/../MyLib/src"/>
    <source-path path-element="${APP_ROOT}/src"/>
    <compiler.external-library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="libs/air" />
        </compiler.external-library-path>

    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
                    <include name="libs" />
                    <include name="../bundles/{locale}" />
                </compiler.library-path>
    <compiler.library-path dir="${APP_ROOT}" append="true">
                    <include name="libs" />
                    <include name="libs/player" />
                </compiler.library-path> 
    <define name="CONFIG::debugging" value="false"/>
     <compiler.debug>false</compiler.debug>             
  </mxmlc>

1 个答案:

答案 0 :(得分:0)

我认为您希望将<load-config>更改为以下其中之一:

<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>

<load-config filename="${FLEX_HOME}/frameworks/airmobile-config.xml"/>